@onyx.dev/onyx-database 0.1.9 → 0.2.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/index.cjs CHANGED
@@ -926,6 +926,17 @@ function clearCacheConfig() {
926
926
  function toSingleCondition(criteria) {
927
927
  return { conditionType: "SingleCondition", criteria };
928
928
  }
929
+ function flattenStrings(values) {
930
+ const flat = [];
931
+ for (const value of values) {
932
+ if (Array.isArray(value)) {
933
+ flat.push(...value);
934
+ } else if (typeof value === "string") {
935
+ flat.push(value);
936
+ }
937
+ }
938
+ return flat;
939
+ }
929
940
  function toCondition(input) {
930
941
  if (typeof input.toCondition === "function") {
931
942
  return input.toCondition();
@@ -1213,12 +1224,12 @@ var QueryBuilderImpl = class {
1213
1224
  return this;
1214
1225
  }
1215
1226
  select(...fields) {
1216
- const flat = fields.flatMap((f) => Array.isArray(f) ? f : [f]);
1227
+ const flat = flattenStrings(fields);
1217
1228
  this.fields = flat.length > 0 ? flat : null;
1218
1229
  return this;
1219
1230
  }
1220
1231
  resolve(...values) {
1221
- const flat = values.flatMap((v) => Array.isArray(v) ? v : [v]);
1232
+ const flat = flattenStrings(values);
1222
1233
  this.resolvers = flat.length > 0 ? flat : null;
1223
1234
  return this;
1224
1235
  }