@rkmodules/rules 0.0.93 → 0.0.94

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
@@ -273,10 +273,10 @@ function mapTree(tree, fn) {
273
273
  });
274
274
  }
275
275
  function mapTreeBranch(tree, fn) {
276
- return nAryOnTreeBranch([tree], function mapTreeBranchCallback(_a, _b) {
276
+ return nAryOnTreeBranch([tree], function mapTreeBranchCallback(_a, _b, index) {
277
277
  var _c = __read(_a, 1), branch = _c[0];
278
278
  var _d = __read(_b, 1), path = _d[0];
279
- return fn(branch || [], path);
279
+ return fn(branch || [], path, index);
280
280
  });
281
281
  }
282
282
  /**
@@ -300,7 +300,7 @@ function nAryOnTreeBranch(trees, fn) {
300
300
  // get all the paths of which the trees are the longest, use the first
301
301
  var maxPaths = paths.filter(function (_, i) { return allKeys[i].length === maxBranches; });
302
302
  var path = maxPaths[0];
303
- var newBranch = fn(branches, paths);
303
+ var newBranch = fn(branches, paths, i);
304
304
  if (newBranch !== DISCARD) {
305
305
  result[path] = newBranch;
306
306
  }
@@ -366,10 +366,10 @@ function nAryOnTree(trees, fn, fill) {
366
366
  * @returns
367
367
  */
368
368
  function binaryOnTreeBranch(treeA, treeB, fn) {
369
- return nAryOnTreeBranch([treeA, treeB], function binaryOnTreeBranchCallback(_a, _b) {
369
+ return nAryOnTreeBranch([treeA, treeB], function binaryOnTreeBranchCallback(_a, _b, index) {
370
370
  var _c = __read(_a, 2), branchA = _c[0], branchB = _c[1];
371
371
  var _d = __read(_b, 2), pathA = _d[0], pathB = _d[1];
372
- return fn(branchA || [], branchB || [], pathA, pathB);
372
+ return fn(branchA || [], branchB || [], pathA, pathB, index);
373
373
  });
374
374
  }
375
375
  /**