UNPKG

@discipl/law-reg

Version:

Discipl Law and Regulation Compliance Library

15 lines (12 loc) 466 B
import Big from 'big.js' import { BaseSubExpressionChecker } from './baseSubExpressionChecker' export class LiteralExpressionChecker extends BaseSubExpressionChecker { async checkSubExpression (fact, ssid, context) { let literalValue = fact.operand if (typeof literalValue === 'number') { literalValue = Big(literalValue) } this._getContextExplainer().extendContextExplanationWithResult(context, literalValue) return literalValue } }