@briza/illogical 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/illogical.cjs +3165 -177
- package/lib/illogical.esm.js +3165 -177
- package/package.json +37 -12
- package/readme.md +57 -846
- package/types/bytecode/compiler.d.ts +29 -0
- package/types/bytecode/evaluable.d.ts +14 -0
- package/types/bytecode/get-bytecode.d.ts +1 -0
- package/types/bytecode/interpreter.d.ts +10 -0
- package/types/bytecode/opcodes.d.ts +51 -0
- package/types/bytecode/operateWithExpectedDecimals.d.ts +1 -0
- package/types/bytecode/refs.d.ts +73 -0
- package/types/bytecode/simplifier.d.ts +16 -0
- package/types/common/type-check.d.ts +2 -2
- package/types/index.d.ts +5 -1
- package/types/parser/options.d.ts +12 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@briza/illogical",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "A micro conditional javascript engine used to parse the raw logical and comparison expressions, evaluate the expression in the given data context, and provide access to a text form of the given expressions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/illogical.cjs",
|
|
@@ -21,15 +21,40 @@
|
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"scripts": {
|
|
23
23
|
"type-check": "tsc --noEmit",
|
|
24
|
-
"build:types": "tsc --emitDeclarationOnly",
|
|
24
|
+
"build:types": "tsc --project tsconfig.build.json --emitDeclarationOnly",
|
|
25
25
|
"build:js": "rollup -c",
|
|
26
26
|
"build": "rm -rf lib types && npm run build:types && npm run build:js",
|
|
27
27
|
"docs": "typedoc src && git checkout docs/.nojekyll",
|
|
28
|
-
"test": "
|
|
28
|
+
"test": "node --import tsx --test \"src/**/*.test.ts\"",
|
|
29
|
+
"test:sample-conditions": "node --import tsx --test --test-reporter=spec \"src/__test__/unit/sample-conditions.test.ts\"",
|
|
30
|
+
"test:coverage": "node --import tsx --test --experimental-test-coverage --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=coverage.lcov \"src/**/*.test.ts\"",
|
|
29
31
|
"lint": "eslint --max-warnings 0 \"src/**/*.{ts,js}\"",
|
|
30
32
|
"lint:fix": "eslint --max-warnings 0 \"src/**/*.{ts,js}\" --fix",
|
|
31
33
|
"prepublishOnly": "npm run test && npm run build",
|
|
32
|
-
"check-licenses": "license-checker --summary --excludePrivatePackages --onlyAllow \"MIT;MIT OR X11;Apache-2.0;ISC;BSD-3-Clause;BSD-2-Clause;CC-BY-4.0;Public Domain;BSD;CC-BY-3.0;CC0-1.0;Python-2.0;BlueOak-1.0.0;Unlicense\""
|
|
34
|
+
"check-licenses": "license-checker --summary --excludePrivatePackages --onlyAllow \"MIT;MIT OR X11;Apache-2.0;ISC;BSD-3-Clause;BSD-2-Clause;CC-BY-4.0;Public Domain;BSD;CC-BY-3.0;CC0-1.0;Python-2.0;BlueOak-1.0.0;Unlicense\"",
|
|
35
|
+
"bench": "npm run build && node --import tsx src/benchmark/evaluate.ts --cases conditions/sample-conditions --out benchmark/results-sample-evaluate-oop.json && node --import tsx src/benchmark/evaluate.ts --cases conditions/sample-conditions --options '{\"evaluator\":\"bytecode\"}' --out benchmark/results-sample-evaluate-bytecode.json && node --import tsx src/benchmark/evaluate.ts --cases conditions/synthetic-conditions --out benchmark/results-synthetic-evaluate-oop.json && node --import tsx src/benchmark/evaluate.ts --cases conditions/synthetic-conditions --options '{\"evaluator\":\"bytecode\"}' --out benchmark/results-synthetic-evaluate-bytecode.json && node --import tsx src/benchmark/simplify.ts --cases conditions/sample-conditions --out benchmark/results-sample-simplify-oop.json && node --import tsx src/benchmark/simplify.ts --cases conditions/sample-conditions --options '{\"evaluator\":\"bytecode\"}' --out benchmark/results-sample-simplify-bytecode.json && node --import tsx src/benchmark/simplify.ts --cases conditions/synthetic-conditions --out benchmark/results-synthetic-simplify-oop.json && node --import tsx src/benchmark/simplify.ts --cases conditions/synthetic-conditions --options '{\"evaluator\":\"bytecode\"}' --out benchmark/results-synthetic-simplify-bytecode.json && node --import tsx src/benchmark/report.ts benchmark/results-sample-evaluate-oop.json benchmark/results-sample-evaluate-bytecode.json --op evaluate --out benchmark/report-sample-evaluate.md && node --import tsx src/benchmark/report.ts benchmark/results-synthetic-evaluate-oop.json benchmark/results-synthetic-evaluate-bytecode.json --op evaluate --out benchmark/report-synthetic-evaluate.md && node --import tsx src/benchmark/report.ts benchmark/results-sample-simplify-oop.json benchmark/results-sample-simplify-bytecode.json --op simplify --out benchmark/report-sample-simplify.md && node --import tsx src/benchmark/report.ts benchmark/results-synthetic-simplify-oop.json benchmark/results-synthetic-simplify-bytecode.json --op simplify --out benchmark/report-synthetic-simplify.md",
|
|
36
|
+
"bench:sample:oop:evaluate": "npm run build && node --import tsx src/benchmark/evaluate.ts --cases conditions/sample-conditions --out benchmark/results-sample-evaluate-oop.json",
|
|
37
|
+
"bench:sample:oop:simplify": "npm run build && node --import tsx src/benchmark/simplify.ts --cases conditions/sample-conditions --out benchmark/results-sample-simplify-oop.json",
|
|
38
|
+
"bench:synthetic:oop:evaluate": "npm run build && node --import tsx src/benchmark/evaluate.ts --cases conditions/synthetic-conditions --out benchmark/results-synthetic-evaluate-oop.json",
|
|
39
|
+
"bench:synthetic:oop:simplify": "npm run build && node --import tsx src/benchmark/simplify.ts --cases conditions/synthetic-conditions --out benchmark/results-synthetic-simplify-oop.json",
|
|
40
|
+
"bench:sample:bytecode:evaluate": "npm run build && node --import tsx src/benchmark/evaluate.ts --cases conditions/sample-conditions --options '{\"evaluator\":\"bytecode\"}' --out benchmark/results-sample-evaluate-bytecode.json",
|
|
41
|
+
"bench:synthetic:bytecode:evaluate": "npm run build && node --import tsx src/benchmark/evaluate.ts --cases conditions/synthetic-conditions --options '{\"evaluator\":\"bytecode\"}' --out benchmark/results-synthetic-evaluate-bytecode.json",
|
|
42
|
+
"bench:sample:bytecode:simplify": "npm run build && node --import tsx src/benchmark/simplify.ts --cases conditions/sample-conditions --options '{\"evaluator\":\"bytecode\"}' --out benchmark/results-sample-simplify-bytecode.json",
|
|
43
|
+
"bench:synthetic:bytecode:simplify": "npm run build && node --import tsx src/benchmark/simplify.ts --cases conditions/synthetic-conditions --options '{\"evaluator\":\"bytecode\"}' --out benchmark/results-synthetic-simplify-bytecode.json",
|
|
44
|
+
"bench:sample:compare:evaluate": "node --import tsx src/benchmark/compare.ts benchmark/results-sample-evaluate-oop.json benchmark/results-sample-evaluate-bytecode.json",
|
|
45
|
+
"bench:synthetic:compare:evaluate": "node --import tsx src/benchmark/compare.ts benchmark/results-synthetic-evaluate-oop.json benchmark/results-synthetic-evaluate-bytecode.json",
|
|
46
|
+
"bench:sample:compare:simplify": "node --import tsx src/benchmark/compare.ts benchmark/results-sample-simplify-oop.json benchmark/results-sample-simplify-bytecode.json",
|
|
47
|
+
"bench:synthetic:compare:simplify": "node --import tsx src/benchmark/compare.ts benchmark/results-synthetic-simplify-oop.json benchmark/results-synthetic-simplify-bytecode.json",
|
|
48
|
+
"bench:sample:report:evaluate": "node --import tsx src/benchmark/report.ts benchmark/results-sample-evaluate-oop.json benchmark/results-sample-evaluate-bytecode.json --op evaluate --out benchmark/report-sample-evaluate.md",
|
|
49
|
+
"bench:synthetic:report:evaluate": "node --import tsx src/benchmark/report.ts benchmark/results-synthetic-evaluate-oop.json benchmark/results-synthetic-evaluate-bytecode.json --op evaluate --out benchmark/report-synthetic-evaluate.md",
|
|
50
|
+
"bench:sample:report:full:evaluate": "node --import tsx src/benchmark/report.ts benchmark/results-sample-evaluate-oop.json benchmark/results-sample-evaluate-bytecode.json --op evaluate --full --out benchmark/report-sample-evaluate-full.md",
|
|
51
|
+
"bench:synthetic:report:full:evaluate": "node --import tsx src/benchmark/report.ts benchmark/results-synthetic-evaluate-oop.json benchmark/results-synthetic-evaluate-bytecode.json --op evaluate --full --out benchmark/report-synthetic-evaluate-full.md",
|
|
52
|
+
"bench:sample:report:simplify": "node --import tsx src/benchmark/report.ts benchmark/results-sample-simplify-oop.json benchmark/results-sample-simplify-bytecode.json --op simplify --out benchmark/report-sample-simplify.md",
|
|
53
|
+
"bench:synthetic:report:simplify": "node --import tsx src/benchmark/report.ts benchmark/results-synthetic-simplify-oop.json benchmark/results-synthetic-simplify-bytecode.json --op simplify --out benchmark/report-synthetic-simplify.md",
|
|
54
|
+
"bench:sample:report:full:simplify": "node --import tsx src/benchmark/report.ts benchmark/results-sample-simplify-oop.json benchmark/results-sample-simplify-bytecode.json --op simplify --full --out benchmark/report-sample-simplify-full.md",
|
|
55
|
+
"bench:synthetic:report:full:simplify": "node --import tsx src/benchmark/report.ts benchmark/results-synthetic-simplify-oop.json benchmark/results-synthetic-simplify-bytecode.json --op simplify --full --out benchmark/report-synthetic-simplify-full.md",
|
|
56
|
+
"get-bytecode": "node --import tsx src/bytecode/get-bytecode.ts",
|
|
57
|
+
"debug-bytecode": "node --import tsx src/tools/debugger.ts"
|
|
33
58
|
},
|
|
34
59
|
"repository": {
|
|
35
60
|
"type": "git",
|
|
@@ -52,11 +77,11 @@
|
|
|
52
77
|
"@babel/preset-typescript": "^7.28.5",
|
|
53
78
|
"@eslint/eslintrc": "^3.3.3",
|
|
54
79
|
"@eslint/js": "^9.39.2",
|
|
55
|
-
"@rollup/plugin-babel": "^
|
|
56
|
-
"@rollup/plugin-commonjs": "^
|
|
80
|
+
"@rollup/plugin-babel": "^7.0.0",
|
|
81
|
+
"@rollup/plugin-commonjs": "^29.0.2",
|
|
57
82
|
"@rollup/plugin-eslint": "^9.1.0",
|
|
58
|
-
"@rollup/plugin-node-resolve": "^
|
|
59
|
-
"@types/
|
|
83
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
84
|
+
"@types/node": "^25.5.0",
|
|
60
85
|
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
|
61
86
|
"@typescript-eslint/parser": "^8.54.0",
|
|
62
87
|
"eslint": "^9.39.2",
|
|
@@ -67,12 +92,12 @@
|
|
|
67
92
|
"eslint-plugin-prettier": "^5.5.5",
|
|
68
93
|
"eslint-plugin-promise": "^7.2.1",
|
|
69
94
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
70
|
-
"jest": "^29.7.0",
|
|
71
95
|
"license-checker": "^25.0.1",
|
|
72
96
|
"prettier": "^3.6.2",
|
|
73
97
|
"rollup": "^4.52.5",
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
98
|
+
"tinybench": "^6.0.0",
|
|
99
|
+
"tsx": "^4.19.1",
|
|
100
|
+
"typedoc": "^0.28.18",
|
|
101
|
+
"typescript": "^6.0.2"
|
|
77
102
|
}
|
|
78
103
|
}
|