@evergis/condition
Advanced tools
Comparing version 1.0.2 to 1.0.3
import { ExpressionTokenizerError } from './ExpressionTokenizer'; | ||
import { BoolNodeVisitReturnType, Expression } from './ConditionVisitor'; | ||
import { ExpressionVisitorError } from './ExpressionVisitor'; | ||
declare type ConditionInterpreterResult = null | BoolNodeVisitReturnType | ExpressionVisitorError | ExpressionTokenizerError | Expression; | ||
export declare const isBoolResult: (result: ConditionInterpreterResult) => result is BoolNodeVisitReturnType; | ||
export declare const isExpression: (result: ConditionInterpreterResult) => result is Expression; | ||
export declare class ConditionInterpreter { | ||
@@ -10,1 +13,2 @@ private readonly tokenizer; | ||
} | ||
export {}; |
@@ -7,4 +7,4 @@ "use strict"; | ||
const isObject_1 = require("./isObject"); | ||
const isBoolResult = (result) => isObject_1.isObject(result) && 'boolOperations' in result; | ||
const isExpression = (result) => isObject_1.isObject(result) && 'attribute' in result; | ||
exports.isBoolResult = (result) => isObject_1.isObject(result) && 'boolOperations' in result; | ||
exports.isExpression = (result) => isObject_1.isObject(result) && 'attribute' in result; | ||
class ConditionInterpreter { | ||
@@ -23,6 +23,6 @@ constructor(condition) { | ||
const result = ast && ast.accept(new ConditionVisitor_1.ConditionVisitor()); | ||
if (isBoolResult(result)) { | ||
if (exports.isBoolResult(result)) { | ||
this.result = result; | ||
} | ||
else if (isExpression(result)) { | ||
else if (exports.isExpression(result)) { | ||
this.result = { | ||
@@ -29,0 +29,0 @@ boolOperations: [], |
export { AcceptTree } from './AcceptTree'; | ||
export { Char } from './Char'; | ||
export { ConditionEvaluator } from './ConditionEvaluator'; | ||
export { ConditionInterpreter } from './ConditionInterpreter'; | ||
export { ConditionInterpreter, isBoolResult, isExpression } from './ConditionInterpreter'; | ||
export { ConditionVisitor, ConditionVisitorReturnType, Expression, BoolNodeVisitReturnType, } from './ConditionVisitor'; | ||
@@ -6,0 +6,0 @@ export { evaluateCondition } from './evaluateCondition'; |
@@ -11,2 +11,4 @@ "use strict"; | ||
exports.ConditionInterpreter = ConditionInterpreter_1.ConditionInterpreter; | ||
exports.isBoolResult = ConditionInterpreter_1.isBoolResult; | ||
exports.isExpression = ConditionInterpreter_1.isExpression; | ||
var ConditionVisitor_1 = require("./ConditionVisitor"); | ||
@@ -13,0 +15,0 @@ exports.ConditionVisitor = ConditionVisitor_1.ConditionVisitor; |
{ | ||
"name": "@evergis/condition", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Condition parser for spcore expressions", | ||
@@ -5,0 +5,0 @@ "author": "Kirill Protasov <kprotasov@everpoint.ru>", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37587
937