dgraph-compiler/src/node-types/claim.ts

21 lines
564 B
TypeScript
Raw Normal View History

2023-09-05 19:30:37 -05:00
import { Node } from "./abstract-node";
export class ClaimNode extends Node{
public static readonly TYPE = 'claim';
public static readonly TYPE_PATTERN = /^\{CLM\}/;
2023-09-19 16:59:33 -05:00
public static readonly SYMBOL = "{CLM}";
2023-09-05 19:30:37 -05:00
public constructor(name: string, data: string) {
super(name, data);
}
public static load(fileName: string, fileData: string) {
const name = fileName.replace(ClaimNode.TYPE_PATTERN, '')
.replace('.md', '')
.trim();
return new ClaimNode(name, fileData);
}
}