UNPKG

ifc-expressions

Version:

Parsing and evaluation of IFC expressions

34 lines (33 loc) 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FuncArgBase = void 0; const FuncArg_js_1 = require("../FuncArg.js"); const ExprEvalResult_js_1 = require("../../ExprEvalResult.js"); class FuncArgBase extends FuncArg_js_1.FuncArg { constructor(required, name, defaultValue) { super(required, name, defaultValue); } transformValue(callingExpr, invocationValue) { if ((0, ExprEvalResult_js_1.isExprEvalSuccess)(invocationValue)) { return this.transformForTypeCheck(callingExpr, invocationValue); } return this.transformForError(callingExpr, invocationValue); } /** * Override to type-check the successfully evaluated invocationValue. * @protected */ transformForTypeCheck(callingExpr, invocationValue) { return invocationValue; } /** * Override to transform the error result obtained from evaluating the invocation value. * @param invocationValue * @protected */ transformForError(callingExpr, invocationValue) { return invocationValue; } } exports.FuncArgBase = FuncArgBase; //# sourceMappingURL=FuncArgBase.js.map