@jsonjoy.com/json-expression
Version:
High-performance JSON Pointer implementation
32 lines (31 loc) • 816 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.Expression = exports.Literal = void 0;
/**
* Represents an expression {@link types.Expr} which was evaluated by codegen and
* which value is already know at compilation time, hence it can be emitted
* as a literal.
*/
class Literal {
constructor(val) {
this.val = val;
}
toString() {
return JSON.stringify(this.val);
}
}
exports.Literal = Literal;
/**
* Represents an expression {@link types.Expr} which was evaluated by codegen and
* which value is not yet known at compilation time, hence its value will
* be evaluated at runtime.
*/
class Expression {
constructor(val) {
this.val = val;
}
toString() {
return this.val;
}
}
exports.Expression = Expression;
;