@rkmodules/rules 0.0.55 → 0.0.56

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
@@ -808,8 +808,8 @@ var greaterThan = {
808
808
  label: "Greater Than",
809
809
  description: "Compare on greater than or greater than or equal to",
810
810
  inputs: {
811
- a: "number",
812
- b: "number",
811
+ a: { type: "number", default: 0 },
812
+ b: { type: "number", default: 0 },
813
813
  },
814
814
  outputs: {
815
815
  gt: "boolean",
@@ -819,9 +819,13 @@ var greaterThan = {
819
819
  return __generator(this, function (_a) {
820
820
  return [2 /*return*/, {
821
821
  gt: binaryOnTree(inputs.a, inputs.b, function (itemA, itemB) {
822
+ if (itemA === undefined || itemB === undefined)
823
+ return DISCARD;
822
824
  return itemA > itemB;
823
825
  }, true),
824
826
  gte: binaryOnTree(inputs.a, inputs.b, function (itemA, itemB) {
827
+ if (itemA === undefined || itemB === undefined)
828
+ return DISCARD;
825
829
  return itemA >= itemB;
826
830
  }, true),
827
831
  }];
@@ -834,8 +838,8 @@ var lessThan = {
834
838
  label: "Less Than",
835
839
  description: "Compare on less than or less than or equal to",
836
840
  inputs: {
837
- a: "number",
838
- b: "number",
841
+ a: { type: "number", default: 0 },
842
+ b: { type: "number", default: 0 },
839
843
  },
840
844
  outputs: {
841
845
  lt: "boolean",
@@ -845,9 +849,13 @@ var lessThan = {
845
849
  return __generator(this, function (_a) {
846
850
  return [2 /*return*/, {
847
851
  lt: binaryOnTree(inputs.a, inputs.b, function (itemA, itemB) {
852
+ if (itemA === undefined || itemB === undefined)
853
+ return DISCARD;
848
854
  return itemA < itemB;
849
855
  }, true),
850
856
  lte: binaryOnTree(inputs.a, inputs.b, function (itemA, itemB) {
857
+ if (itemA === undefined || itemB === undefined)
858
+ return DISCARD;
851
859
  return itemA <= itemB;
852
860
  }, true),
853
861
  }];
@@ -967,21 +975,23 @@ var listItem = {
967
975
  },
968
976
  outputs: {
969
977
  item: "any",
978
+ others: "any",
970
979
  },
971
980
  impl: function (inputs) { return __awaiter(void 0, void 0, void 0, function () {
981
+ var item, others;
972
982
  return __generator(this, function (_a) {
983
+ item = binaryOnTreeBranch(inputs.list || {}, inputs.index || {}, function (branch, indices) {
984
+ if (indices) {
985
+ return indices.map(function (i) { return branch[i]; });
986
+ }
987
+ });
988
+ others = binaryOnTreeBranch(inputs.list || {}, inputs.index || {}, function (branch, indices) {
989
+ console.log("others", branch, indices);
990
+ return branch.filter(function (i) { return !(indices === null || indices === void 0 ? void 0 : indices.includes(i)); });
991
+ });
973
992
  return [2 /*return*/, {
974
- // item: mapTreeBranch(inputs.list, (branch, path) => {
975
- // let indices = getBranch(inputs.index, path);
976
- // if (indices) {
977
- // return indices.map((i) => branch[i]);
978
- // }
979
- // }),
980
- item: binaryOnTreeBranch(inputs.list || {}, inputs.index || {}, function (branch, indices) {
981
- if (indices) {
982
- return indices.map(function (i) { return branch[i]; });
983
- }
984
- }),
993
+ item: item,
994
+ others: others,
985
995
  }];
986
996
  });
987
997
  }); },