Files
languageservices/actions-expressions/src/data/boolean.ts
T
2023-01-06 15:54:31 -08:00

26 lines
435 B
TypeScript

import { ExpressionDataInterface, Kind } from "./expressiondata";
export class BooleanData implements ExpressionDataInterface {
constructor(public readonly value: boolean) {}
public readonly kind = Kind.Boolean;
public primitive = true;
coerceString(): string {
if (this.value) {
return "true";
}
return "false";
}
number(): number {
if (this.value) {
return 1;
}
return 0;
}
}