UNPKG

@clickup/ent-framework

Version:

A PostgreSQL graph-database-alike library with microsharding and row-level security

19 lines (15 loc) 467 B
import type { VC } from "../VC"; import type { VCFlavor } from "../VCFlavor"; import type { Predicate } from "./Predicate"; /** * Checks that the VC has some flavor. */ export class VCHasFlavor implements Predicate<never> { readonly name; constructor(private Flavor: new (...args: never[]) => VCFlavor) { this.name = this.constructor.name + ":" + this.Flavor.name; } async check(vc: VC): Promise<boolean> { return !!vc.flavor(this.Flavor); } }