@rkmodules/rules 0.0.89 → 0.0.90

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.esm.js CHANGED
@@ -1129,6 +1129,75 @@ var tanDeg = {
1129
1129
  }); },
1130
1130
  };
1131
1131
 
1132
+ var ceil = {
1133
+ name: "ceil",
1134
+ label: "Round up",
1135
+ description: "Round a number up to the nearest integer",
1136
+ inputs: {
1137
+ x: { type: "number", default: 0 },
1138
+ },
1139
+ outputs: {
1140
+ ceil: "number",
1141
+ },
1142
+ impl: function (inputs) { return __awaiter(void 0, void 0, void 0, function () {
1143
+ return __generator(this, function (_a) {
1144
+ return [2 /*return*/, {
1145
+ ceil: mapTree(inputs.x, function (x) {
1146
+ if (x === undefined)
1147
+ return DISCARD;
1148
+ return Math.ceil(x);
1149
+ }),
1150
+ }];
1151
+ });
1152
+ }); },
1153
+ };
1154
+
1155
+ var floor = {
1156
+ name: "floor",
1157
+ label: "Round down",
1158
+ description: "Round a number down to the nearest integer",
1159
+ inputs: {
1160
+ x: { type: "number", default: 0 },
1161
+ },
1162
+ outputs: {
1163
+ floor: "number",
1164
+ },
1165
+ impl: function (inputs) { return __awaiter(void 0, void 0, void 0, function () {
1166
+ return __generator(this, function (_a) {
1167
+ return [2 /*return*/, {
1168
+ floor: mapTree(inputs.x, function (x) {
1169
+ if (x === undefined)
1170
+ return DISCARD;
1171
+ return Math.floor(x);
1172
+ }),
1173
+ }];
1174
+ });
1175
+ }); },
1176
+ };
1177
+
1178
+ var round = {
1179
+ name: "round",
1180
+ label: "Round",
1181
+ description: "Round a number to the nearest integer",
1182
+ inputs: {
1183
+ x: { type: "number", default: 0 },
1184
+ },
1185
+ outputs: {
1186
+ round: "number",
1187
+ },
1188
+ impl: function (inputs) { return __awaiter(void 0, void 0, void 0, function () {
1189
+ return __generator(this, function (_a) {
1190
+ return [2 /*return*/, {
1191
+ round: mapTree(inputs.x, function (x) {
1192
+ if (x === undefined)
1193
+ return DISCARD;
1194
+ return Math.round(x);
1195
+ }),
1196
+ }];
1197
+ });
1198
+ }); },
1199
+ };
1200
+
1132
1201
  var _a$6;
1133
1202
  var primitives$6 = (_a$6 = {},
1134
1203
  _a$6[calc.name] = calc,
@@ -1145,6 +1214,9 @@ var primitives$6 = (_a$6 = {},
1145
1214
  _a$6[tanDeg.name] = tanDeg,
1146
1215
  _a$6[sqrt.name] = sqrt,
1147
1216
  _a$6[pow.name] = pow,
1217
+ _a$6[round.name] = round,
1218
+ _a$6[ceil.name] = ceil,
1219
+ _a$6[floor.name] = floor,
1148
1220
  _a$6);
1149
1221
 
1150
1222
  var filterList = {