parent
6e150a3701
commit
3f37fb4e5e
@ -1,16 +0,0 @@
|
|||||||
export class TagQuery {
|
|
||||||
constructor(public tag: string, public negate: boolean) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static fromString(tag: string): TagQuery {
|
|
||||||
if (tag.startsWith("-")) {
|
|
||||||
return new TagQuery(tag.replace(/^-/g, ""), true);
|
|
||||||
} else {
|
|
||||||
return new TagQuery(tag, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public getNormalizedTag(): string {
|
|
||||||
return this.negate ? "-" + this.tag : this.tag;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
export type RustEnum<VariantData> = {
|
|
||||||
[key: string]: VariantData
|
|
||||||
};
|
|
||||||
|
|
||||||
export function createRustEnum<T, VariantData>(variant: string, data: VariantData): T {
|
|
||||||
let enumInstance: RustEnum<VariantData> = {};
|
|
||||||
enumInstance[variant] = data;
|
|
||||||
|
|
||||||
return enumInstance as unknown as T;
|
|
||||||
}
|
|
Loading…
Reference in New Issue