@rkmodules/rules 0.0.96 → 0.0.98
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 +23 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +21 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/lib/DataTree/index.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -255,9 +255,26 @@ function broadCast(value) {
|
|
|
255
255
|
function getBranch(tree, path) {
|
|
256
256
|
return tree[path];
|
|
257
257
|
}
|
|
258
|
+
function getBranches(tree) {
|
|
259
|
+
return Object.values(tree);
|
|
260
|
+
}
|
|
258
261
|
function getPaths(tree) {
|
|
259
262
|
return Object.keys(tree);
|
|
260
263
|
}
|
|
264
|
+
function forEachBranch(tree, fn) {
|
|
265
|
+
var paths = getPaths(tree);
|
|
266
|
+
paths.forEach(function (path, i) {
|
|
267
|
+
var branch = tree[path];
|
|
268
|
+
fn(branch, path, i);
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
function forEachItem(tree, fn) {
|
|
272
|
+
forEachBranch(tree, function (branch, path, pathIndex) {
|
|
273
|
+
branch.forEach(function (item, i) {
|
|
274
|
+
fn(item, path, pathIndex, i);
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
}
|
|
261
278
|
/**
|
|
262
279
|
* maps a tree, the tree branches are flatmapped, so if an array is returned for each item in the list, a flat list is returned
|
|
263
280
|
* @param tree
|
|
@@ -1558,7 +1575,9 @@ var listInput = {
|
|
|
1558
1575
|
tree: mapTreeBranch(inputs.list || {}, function (branch) {
|
|
1559
1576
|
if (!branch || branch.length === 0)
|
|
1560
1577
|
return DISCARD;
|
|
1561
|
-
var allLines = branch.flatMap(function (text) {
|
|
1578
|
+
var allLines = branch.flatMap(function (text) {
|
|
1579
|
+
return text.replace(/(^[\n\r]+)|([\n\r]+$)/, "").split("\n");
|
|
1580
|
+
});
|
|
1562
1581
|
if (allLines.every(function (line) { return isBoolStr(line); })) {
|
|
1563
1582
|
allLines = allLines.map(function (line) { return line.toLowerCase() === "true"; });
|
|
1564
1583
|
}
|
|
@@ -7239,5 +7258,5 @@ function DDContext(_a) {
|
|
|
7239
7258
|
return React.createElement(DndProvider, { backend: HTML5Backend }, children);
|
|
7240
7259
|
}
|
|
7241
7260
|
|
|
7242
|
-
export { DDContext, DISCARD, Engine, Flow, Lib, binaryOnTree, binaryOnTreeBranch, broadCast, expandTree, getBranch, getPaths, getPositions, getReferences, getValue$1 as getValue, getVariable, graftTree, hasReference, interpolate, isReference, isSingleTon, isTree, mapTree, mapTreeBranch, nAryOnTree, nAryOnTreeBranch, normalizeVarDef, parseReference, primitives, sameShape, simplifyTree$1 as simplifyTree, toArray, topSort, treeSize, trimTree, uid$1 as uid, useDraggableNode, useFlow, useFunction, usePositions, useUpdatePositions, useVariable, variableStore };
|
|
7261
|
+
export { DDContext, DISCARD, Engine, Flow, Lib, binaryOnTree, binaryOnTreeBranch, broadCast, expandTree, forEachBranch, forEachItem, getBranch, getBranches, getPaths, getPositions, getReferences, getValue$1 as getValue, getVariable, graftTree, hasReference, interpolate, isReference, isSingleTon, isTree, mapTree, mapTreeBranch, nAryOnTree, nAryOnTreeBranch, normalizeVarDef, parseReference, primitives, sameShape, simplifyTree$1 as simplifyTree, toArray, topSort, treeSize, trimTree, uid$1 as uid, useDraggableNode, useFlow, useFunction, usePositions, useUpdatePositions, useVariable, variableStore };
|
|
7243
7262
|
//# sourceMappingURL=index.esm.js.map
|