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