@rkmodules/rules 0.0.98 → 0.0.99
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 +14 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +13 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/lib/DataTree/index.d.ts +2 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -261,6 +261,12 @@ function getBranches(tree) {
|
|
|
261
261
|
function getPaths(tree) {
|
|
262
262
|
return Object.keys(tree);
|
|
263
263
|
}
|
|
264
|
+
function getItem(tree, path, index) {
|
|
265
|
+
var branch = getBranch(tree, path);
|
|
266
|
+
if (branch) {
|
|
267
|
+
return branch[index];
|
|
268
|
+
}
|
|
269
|
+
}
|
|
264
270
|
function forEachBranch(tree, fn) {
|
|
265
271
|
var paths = getPaths(tree);
|
|
266
272
|
paths.forEach(function (path, i) {
|
|
@@ -275,6 +281,12 @@ function forEachItem(tree, fn) {
|
|
|
275
281
|
});
|
|
276
282
|
});
|
|
277
283
|
}
|
|
284
|
+
function pushItem(tree, path, item) {
|
|
285
|
+
if (!tree[path]) {
|
|
286
|
+
tree[path] = [];
|
|
287
|
+
}
|
|
288
|
+
tree[path].push(item);
|
|
289
|
+
}
|
|
278
290
|
/**
|
|
279
291
|
* 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
|
|
280
292
|
* @param tree
|
|
@@ -7258,5 +7270,5 @@ function DDContext(_a) {
|
|
|
7258
7270
|
return React.createElement(DndProvider, { backend: HTML5Backend }, children);
|
|
7259
7271
|
}
|
|
7260
7272
|
|
|
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 };
|
|
7273
|
+
export { DDContext, DISCARD, Engine, Flow, Lib, binaryOnTree, binaryOnTreeBranch, broadCast, expandTree, forEachBranch, forEachItem, getBranch, getBranches, getItem, getPaths, getPositions, getReferences, getValue$1 as getValue, getVariable, graftTree, hasReference, interpolate, isReference, isSingleTon, isTree, mapTree, mapTreeBranch, nAryOnTree, nAryOnTreeBranch, normalizeVarDef, parseReference, primitives, pushItem, sameShape, simplifyTree$1 as simplifyTree, toArray, topSort, treeSize, trimTree, uid$1 as uid, useDraggableNode, useFlow, useFunction, usePositions, useUpdatePositions, useVariable, variableStore };
|
|
7262
7274
|
//# sourceMappingURL=index.esm.js.map
|