fig-tree-evaluator 2.8.4 → 2.8.6

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/README.md CHANGED
@@ -1691,30 +1691,31 @@ Please open an issue: https://github.com/CarlosNZ/fig-tree-evaluator/issues
1691
1691
 
1692
1692
  *Trivial upgrades (e.g. documentation, small re-factors, types, etc.) not included*
1693
1693
 
1694
+ - **v2.8.6**: Small bug fix where `options` object would be mutated instead of replaced
1695
+ - **v2.8.5**: Small bug fix in [COUNT](#count) operator
1694
1696
  - **v2.8.4**: Refactor types, better compliance with [ESLint](https://eslint.org/) rules, add more tests
1695
1697
  - **v2.8.0**:
1696
- - [Shorthand syntax](#shorthand-syntax) (#80)
1697
- - Methods to retrieve [metadata](#metadata) about operators, fragments and functions (#82)
1698
- - **v2.7.0**: Add `excludeOperators` option to allow certain operators to be prohibited (e.g. database lookups) (#54)
1698
+ - **[Shorthand syntax](#shorthand-syntax)** (#80)
1699
+ - **Methods to retrieve [metadata](#metadata)** about operators, fragments and functions (#82)
1700
+ - **v2.7.0**: **Add `excludeOperators` option** to allow certain operators to be prohibited (e.g. database lookups) (#54)
1699
1701
  - **v2.6.0**: Resolve alias nodes that are not part of an Operator node when `evaluateFullObject` is enabled (#78)
1700
1702
  - **v2.5.0**:
1701
1703
  - Bug fixes for edge cases (mainly related to backwards compatibility)
1702
1704
  - More backwards compatibility for very old (pre-v1) syntax (undocumented)
1703
1705
  - **v2.4.1**: Small bug fix for Fragments edge case
1704
- - **v2.4.0**: Implement [Fragments](#fragments) (#74)
1706
+ - **v2.4.0**: **Implement [Fragments](#fragments)** (#74)
1705
1707
  - **v2.3.2**: Bug fix: alias nodes not working with `evaluateFullObject` (#72)
1706
- - **v2.3.0**: Implement [caching/memoization](#caching-memoization) (#68)
1708
+ - **v2.3.0**: **Implement [caching/memoization](#caching-memoization)** (#68)
1707
1709
  - **v2.2.3**: Change option `objects` name to `data` (but keep backward compatibility) (#66)
1708
- - **v2.2.2**: Option to evaluate whole object if operator nodes are deep within it (#64)
1710
+ - **v2.2.2**: **Option to evaluate whole object** if operator nodes are deep within it (#64)
1709
1711
  - **v2.2.1**: More efficient branch evaluation for condition/match operators (#63)
1710
1712
  - **v2.2.0**:
1711
- - New "[Match](#match)" operator (#61)
1713
+ - **New "[Match](#match)" operator** (#61)
1712
1714
  - Fix for regex incompatibility with Safari (#60)
1713
- - **v2.1.5**: Demo updates (no changes to core evaluator)
1714
1715
  - **v2.1.4**: Upgrade dependencies
1715
- - **v2.1.0**: [Alias nodes](#alias-nodes) (#57)
1716
+ - **v2.1.0**: **[Alias nodes](#alias-nodes)** (#57)
1716
1717
  - **v2.0.4**: Backwards compatibility for customFunctions (#53)
1717
- - **v2.0.1**: Add deep equality comparison for objects/arrays in `=`/`!=` operators
1718
+ - **v2.0.1**: **Add deep equality comparison** for objects/arrays in `=`/`!=` operators
1718
1719
  - **v2.0.0**: Re-write as stand-alone package. Major improvements include:
1719
1720
  - more [operators](#operator-reference)
1720
1721
  - operator (and property) [aliases](#operator--property-aliases)
@@ -111,8 +111,7 @@ const evaluateExpression = (expression, options) => new FigTreeEvaluator(options
111
111
  exports.evaluateExpression = evaluateExpression;
112
112
  const standardiseOptionNames = (options) => {
113
113
  if ('objects' in options) {
114
- options.data = options.objects;
115
- delete options.objects;
114
+ return Object.assign(Object.assign({}, options), { data: options.objects });
116
115
  }
117
116
  return options;
118
117
  };
@@ -33,7 +33,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  };
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  exports.COUNT = void 0;
36
- const operator_1 = require("../AND/operator");
37
36
  const _operatorUtils_1 = require("../_operatorUtils");
38
37
  const data_1 = __importStar(require("./data"));
39
38
  const evaluate = (expression, config) => __awaiter(void 0, void 0, void 0, function* () {
@@ -41,9 +40,13 @@ const evaluate = (expression, config) => __awaiter(void 0, void 0, void 0, funct
41
40
  config.typeChecker((0, _operatorUtils_1.getTypeCheckInput)(data_1.default.parameters, { values }));
42
41
  return values.length;
43
42
  });
43
+ const parseChildren = (expression) => {
44
+ const [values] = expression.children;
45
+ return Object.assign(Object.assign({}, expression), { values });
46
+ };
44
47
  exports.COUNT = {
45
48
  propertyAliases: data_1.propertyAliases,
46
49
  operatorData: data_1.default,
47
50
  evaluate,
48
- parseChildren: operator_1.parseChildren,
51
+ parseChildren,
49
52
  };
@@ -1 +1 @@
1
- export declare const version = "2.8.4";
1
+ export declare const version = "2.8.6";
package/build/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- exports.version = '2.8.4';
4
+ exports.version = '2.8.6';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fig-tree-evaluator",
3
- "version": "2.8.4",
3
+ "version": "2.8.6",
4
4
  "description": "Module to evaluate JSON-structured expression trees",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",