@briza/illogical 1.5.2 → 1.5.3

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/changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # illogical changelog
2
2
 
3
+ ## 1.5.3
4
+
5
+ - Fixed an issue where conditions with object data were not being simplified correctly.
6
+
3
7
  ## 1.5.2
4
8
 
5
9
  - Update dependencies.
@@ -45,7 +45,7 @@ function isBoolean(value) {
45
45
  */
46
46
 
47
47
  function isEvaluable(value) {
48
- return typeof value === 'object' && value !== null && !Array.isArray(value);
48
+ return typeof value === 'object' && value !== null && !Array.isArray(value) && typeof value.evaluate === 'function' && typeof value.simplify === 'function' && typeof value.serialize === 'function' && typeof value.toString === 'function';
49
49
  }
50
50
 
51
51
  function _defineProperty(obj, key, value) {
package/lib/illogical.js CHANGED
@@ -49,7 +49,7 @@ function isBoolean(value) {
49
49
  */
50
50
 
51
51
  function isEvaluable(value) {
52
- return typeof value === 'object' && value !== null && !Array.isArray(value);
52
+ return typeof value === 'object' && value !== null && !Array.isArray(value) && typeof value.evaluate === 'function' && typeof value.simplify === 'function' && typeof value.serialize === 'function' && typeof value.toString === 'function';
53
53
  }
54
54
 
55
55
  function _defineProperty(obj, key, value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@briza/illogical",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
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
  "main": "lib/illogical.js",
6
6
  "module": "lib/illogical.esm.js",
@@ -42,31 +42,31 @@
42
42
  "rules"
43
43
  ],
44
44
  "devDependencies": {
45
- "@babel/core": "^7.16.12",
45
+ "@babel/core": "^7.17.5",
46
46
  "@babel/plugin-proposal-class-properties": "^7.16.7",
47
47
  "@babel/preset-env": "^7.16.11",
48
48
  "@babel/preset-typescript": "^7.16.7",
49
- "@rollup/plugin-babel": "^5.2.3",
50
- "@rollup/plugin-commonjs": "^21.0.1",
49
+ "@rollup/plugin-babel": "^5.3.1",
50
+ "@rollup/plugin-commonjs": "^21.0.2",
51
51
  "@rollup/plugin-node-resolve": "^13.1.3",
52
- "@types/jest": "^27.4.0",
53
- "@typescript-eslint/eslint-plugin": "^5.10.2",
54
- "@typescript-eslint/parser": "^5.10.2",
55
- "eslint": "^8.8.0",
56
- "eslint-config-prettier": "^8.3.0",
52
+ "@types/jest": "^27.4.1",
53
+ "@typescript-eslint/eslint-plugin": "^5.13.0",
54
+ "@typescript-eslint/parser": "^5.13.0",
55
+ "eslint": "^8.10.0",
56
+ "eslint-config-prettier": "^8.4.0",
57
57
  "eslint-import-resolver-typescript": "^2.5.0",
58
58
  "eslint-plugin-import": "^2.25.4",
59
59
  "eslint-plugin-node": "^11.1.0",
60
60
  "eslint-plugin-prettier": "^3.4.1",
61
61
  "eslint-plugin-promise": "^6.0.0",
62
62
  "eslint-plugin-simple-import-sort": "^7.0.0",
63
- "jest": "^27.4.7",
63
+ "jest": "^27.5.1",
64
64
  "license-checker": "^25.0.1",
65
65
  "prettier": "^2.5.1",
66
- "rollup": "^2.66.1",
66
+ "rollup": "^2.69.0",
67
67
  "rollup-plugin-eslint": "^7.0.0",
68
68
  "ts-jest": "^27.1.3",
69
- "typedoc": "^0.22.11",
70
- "typescript": "^4.5.5"
69
+ "typedoc": "^0.22.12",
70
+ "typescript": "4.5.5"
71
71
  }
72
72
  }
@@ -15,7 +15,7 @@ export interface Context {
15
15
  /**
16
16
  * Evaluation result
17
17
  */
18
- export declare type Result = undefined | null | string | number | boolean | Array<Result>;
18
+ export declare type Result = undefined | null | string | number | boolean | Array<Result> | Record<string, unknown>;
19
19
  export declare enum EvaluableType {
20
20
  Operand = "Operand",
21
21
  Expression = "Expression"