@rkmodules/rules 0.0.130 → 0.0.132

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
@@ -373,10 +373,13 @@ function forEachItem(tree, fn) {
373
373
  });
374
374
  });
375
375
  }
376
- function pushItem(tree, path, item) {
376
+ function ensureBranch(tree, path) {
377
377
  if (!tree[path]) {
378
378
  tree[path] = [];
379
379
  }
380
+ }
381
+ function pushItem(tree, path, item) {
382
+ ensureBranch(tree, path);
380
383
  tree[path].push(item);
381
384
  }
382
385
  /**
@@ -2476,6 +2479,8 @@ var explodeObject = {
2476
2479
  branch.forEach(function (obj, index) {
2477
2480
  if (!obj)
2478
2481
  return;
2482
+ if (typeof obj !== "object")
2483
+ obj = null;
2479
2484
  if (obj === null && params.removeEmpty)
2480
2485
  ;
2481
2486
  var props = obj || {};
@@ -2492,6 +2497,15 @@ var explodeObject = {
2492
2497
  });
2493
2498
  });
2494
2499
  });
2500
+ if (!params.removeEmpty) {
2501
+ // ensure the same branches exist in the output even if they are empty, so that the outputs don't change shape when empty branches are added or removed from the input
2502
+ Object.entries(outputs).forEach(function (_a) {
2503
+ var _b = __read(_a, 2); _b[0]; var tree = _b[1];
2504
+ forEachBranch(object, function (branch, path) {
2505
+ ensureBranch(tree, path);
2506
+ });
2507
+ });
2508
+ }
2495
2509
  return [2 /*return*/, outputs];
2496
2510
  });
2497
2511
  }); },
@@ -8165,11 +8179,13 @@ exports.DDContext = DDContext;
8165
8179
  exports.DISCARD = DISCARD;
8166
8180
  exports.Engine = Engine;
8167
8181
  exports.Flow = Flow;
8182
+ exports.FlowContext = FlowContext;
8168
8183
  exports.GenericNode = GenericNode;
8169
8184
  exports.Lib = Lib;
8170
8185
  exports.binaryOnTree = binaryOnTree;
8171
8186
  exports.binaryOnTreeBranch = binaryOnTreeBranch;
8172
8187
  exports.broadCast = broadCast;
8188
+ exports.ensureBranch = ensureBranch;
8173
8189
  exports.expandTree = expandTree;
8174
8190
  exports.forEachBranch = forEachBranch;
8175
8191
  exports.forEachItem = forEachItem;
@@ -8206,10 +8222,14 @@ exports.treeSize = treeSize;
8206
8222
  exports.treeStats = treeStats;
8207
8223
  exports.trimTree = trimTree;
8208
8224
  exports.uid = uid$1;
8225
+ exports.useControls = useControls;
8209
8226
  exports.useDraggableNode = useDraggableNode;
8227
+ exports.useEngine = useEngine;
8210
8228
  exports.useFlow = useFlow;
8211
8229
  exports.useFunction = useFunction;
8230
+ exports.useGraphedFunction = useGraphedFunction;
8212
8231
  exports.usePositions = usePositions;
8232
+ exports.usePrompts = usePrompts;
8213
8233
  exports.useUpdatePositions = useUpdatePositions;
8214
8234
  exports.useVariable = useVariable;
8215
8235
  exports.variableStore = variableStore;