@rkmodules/rules 0.0.87 → 0.0.89
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/dist/index.cjs.js
CHANGED
|
@@ -343,7 +343,8 @@ function nAryOnTree(trees, fn, fill) {
|
|
|
343
343
|
});
|
|
344
344
|
var result = fn(items, paths, i);
|
|
345
345
|
if (result !== DISCARD) {
|
|
346
|
-
|
|
346
|
+
var resultArray = [].concat(result);
|
|
347
|
+
results.push.apply(results, __spreadArray([], __read(resultArray), false));
|
|
347
348
|
}
|
|
348
349
|
};
|
|
349
350
|
for (var i = 0; i < maxLength; i++) {
|
|
@@ -5562,7 +5563,15 @@ var useVariable = function (scope, name, initial, persist) {
|
|
|
5562
5563
|
var setValue = function (value) { return setVar(scope, name, value, persist); };
|
|
5563
5564
|
return [value, setValue];
|
|
5564
5565
|
};
|
|
5566
|
+
var getVariable = function (scope, name, persist) {
|
|
5567
|
+
if (persist === void 0) { persist = true; }
|
|
5568
|
+
var value = variableStore.getState().getVar(scope, name, persist);
|
|
5569
|
+
return value;
|
|
5570
|
+
};
|
|
5565
5571
|
|
|
5572
|
+
function getPositions(fn) {
|
|
5573
|
+
return getVariable("rules", "".concat(fn.name, ".positions"), true);
|
|
5574
|
+
}
|
|
5566
5575
|
function usePositions(fn) {
|
|
5567
5576
|
return useVariable("rules", "".concat(fn.name, ".positions"), {});
|
|
5568
5577
|
}
|
|
@@ -6966,8 +6975,10 @@ exports.broadCast = broadCast;
|
|
|
6966
6975
|
exports.expandTree = expandTree;
|
|
6967
6976
|
exports.getBranch = getBranch;
|
|
6968
6977
|
exports.getPaths = getPaths;
|
|
6978
|
+
exports.getPositions = getPositions;
|
|
6969
6979
|
exports.getReferences = getReferences;
|
|
6970
6980
|
exports.getValue = getValue$1;
|
|
6981
|
+
exports.getVariable = getVariable;
|
|
6971
6982
|
exports.graftTree = graftTree;
|
|
6972
6983
|
exports.hasReference = hasReference;
|
|
6973
6984
|
exports.interpolate = interpolate;
|
|
@@ -6994,4 +7005,5 @@ exports.useFunction = useFunction;
|
|
|
6994
7005
|
exports.usePositions = usePositions;
|
|
6995
7006
|
exports.useUpdatePositions = useUpdatePositions;
|
|
6996
7007
|
exports.useVariable = useVariable;
|
|
7008
|
+
exports.variableStore = variableStore;
|
|
6997
7009
|
//# sourceMappingURL=index.cjs.js.map
|