File size: 380 Bytes
d76f93d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
export class Link<T = any> {
table: string;
id: string;
constructor(table: string, id: string) {
this.table = table;
this.id = id;
}
static fromString(linkStr: string): Link {
const [table, id] = linkStr.split(":");
return new Link(table, id);
}
toString(): string {
return `${this.table}:${this.id}`;
}
}
|