@discipl/law-reg
Version:
Discipl Law and Regulation Compliance Library
24 lines (16 loc) • 766 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NotExpressionChecker = void 0;
var _baseSubExpressionChecker = require("./baseSubExpressionChecker");
class NotExpressionChecker extends _baseSubExpressionChecker.BaseSubExpressionChecker {
async checkSubExpression(fact, ssid, context) {
const newContext = this._getContextExplainer().extendContextWithExplanation(context);
const value = await this._getExpressionChecker().checkExpression(fact.operand, ssid, newContext);
const notResult = typeof value === 'boolean' ? !value : undefined;
this._getContextExplainer().extendContextExplanationWithResult(context, notResult);
return notResult;
}
}
exports.NotExpressionChecker = NotExpressionChecker;