@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
@@ -1,4 +1,4 @@
1
- /*! API v30.11. Copyright 2018-2024 trebco, llc. All rights reserved. LGPL: https://treb.app/license */
1
+ /*! API v30.12. Copyright 2018-2024 trebco, llc. All rights reserved. LGPL: https://treb.app/license */
2
2
 
3
3
  /**
4
4
  * add our tag to the map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trebco/treb",
3
- "version": "30.11.2",
3
+ "version": "30.12.0",
4
4
  "license": "LGPL-3.0-or-later",
5
5
  "homepage": "https://treb.app",
6
6
  "repository": {
@@ -867,6 +867,9 @@ export const BaseFunctionLibrary: FunctionMap = {
867
867
  value = !!arg.value;
868
868
  break;
869
869
 
870
+ case ValueType.error:
871
+ return arg;
872
+
870
873
  }
871
874
  }
872
875
 
@@ -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
- const apply = args.map((arg, index) => arrays[index] ? (arrays[index][i][j] || { type: ValueType.undefined }) : arg);
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