fig-tree-evaluator 2.5.2 → 2.6.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/README.md +1 -0
- package/build/helpers.js +14 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1510,6 +1510,7 @@ Please open an issue: https://github.com/CarlosNZ/fig-tree-evaluator/issues
|
|
|
1510
1510
|
|
|
1511
1511
|
*Trivial upgrades (e.g. documentation, small re-factors, types, etc.) not included*
|
|
1512
1512
|
|
|
1513
|
+
- **v2.6.0**: Resolve alias nodes that are not part of an Operator node when `evaluateFullObject` is enabled (#78)
|
|
1513
1514
|
- **v2.5.0**:
|
|
1514
1515
|
- Bug fixes for edge cases (mainly related to backwards compatibility)
|
|
1515
1516
|
- More backwards compatibility for very old (pre-v1) syntax (undocumented)
|
package/build/helpers.js
CHANGED
|
@@ -116,8 +116,19 @@ const evaluateObject = (input, config) => __awaiter(void 0, void 0, void 0, func
|
|
|
116
116
|
if (!(0, exports.isObject)(input))
|
|
117
117
|
return input;
|
|
118
118
|
const newObjectEntries = [];
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
const newAliases = [];
|
|
120
|
+
Object.entries(input).forEach(([key, value]) => {
|
|
121
|
+
if (isAliasString(key)) {
|
|
122
|
+
newAliases.push(key, (0, evaluate_1.evaluatorFunction)(value, config));
|
|
123
|
+
delete input[key];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
const aliasArray = yield Promise.all(newAliases);
|
|
127
|
+
config.resolvedAliasNodes = Object.assign(Object.assign({}, config.resolvedAliasNodes), (0, _operatorUtils_1.singleArrayToObject)(aliasArray));
|
|
128
|
+
Object.entries(input).forEach(([key, value]) => {
|
|
129
|
+
newObjectEntries.push(key, (0, evaluate_1.evaluatorFunction)(value, config));
|
|
130
|
+
});
|
|
131
|
+
const results = yield Promise.all(newObjectEntries);
|
|
132
|
+
return (0, exports.replaceAliasNodeValues)((0, _operatorUtils_1.singleArrayToObject)(results), config);
|
|
122
133
|
});
|
|
123
134
|
exports.evaluateObject = evaluateObject;
|