@trebco/treb 30.11.2 → 30.12.0
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/treb.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -280,7 +280,9 @@ export const ApplyArrayX = <TFunc extends (...args: any[]) => UnionValue>(map: b
|
|
|
280
280
|
let shape: unknown[][] = [];
|
|
281
281
|
|
|
282
282
|
for (const [i, arg] of args.entries()) {
|
|
283
|
+
|
|
283
284
|
if (arg && map[i]) {
|
|
285
|
+
|
|
284
286
|
const arr = Array.isArray(arg) ? arg : IsArrayUnion(arg) ? arg.value : undefined;
|
|
285
287
|
if (arr) {
|
|
286
288
|
arrays[i] = arr;
|
|
@@ -298,8 +300,15 @@ export const ApplyArrayX = <TFunc extends (...args: any[]) => UnionValue>(map: b
|
|
|
298
300
|
return {
|
|
299
301
|
type: ValueType.array,
|
|
300
302
|
value: shape.map((_, i) => _.map((_, j) => {
|
|
301
|
-
|
|
303
|
+
|
|
304
|
+
// this was breaking on boolean false, because
|
|
305
|
+
// it used || instead of ??. if we don't require
|
|
306
|
+
// boxed arguments, we need to handle naked booleans
|
|
307
|
+
|
|
308
|
+
const apply = args.map((arg, index) => arrays[index] ? (arrays[index][i][j] ?? { type: ValueType.undefined }) : arg);
|
|
309
|
+
|
|
302
310
|
return base(...apply as Parameters<TFunc>);
|
|
311
|
+
|
|
303
312
|
})),
|
|
304
313
|
};
|
|
305
314
|
|