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