inibase 1.1.28 → 1.1.29
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.js +21 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -890,27 +890,32 @@ export default class Inibase {
|
|
|
890
890
|
searchableIDs.set(lineNumber, lineContent);
|
|
891
891
|
}
|
|
892
892
|
if (searchableIDs.size) {
|
|
893
|
-
const items = await this.get(field.table, Array.from(new Set(Array.from(searchableIDs.values()).flat()))
|
|
893
|
+
const items = await this.get(field.table, Array.from(new Set(Array.from(searchableIDs.values()).flat()))
|
|
894
|
+
.flat()
|
|
895
|
+
.filter((item) => item), {
|
|
894
896
|
...options,
|
|
895
897
|
perPage: Number.POSITIVE_INFINITY,
|
|
896
898
|
columns: options.columns
|
|
897
899
|
?.filter((column) => column.includes(`${field.key}.`))
|
|
898
900
|
.map((column) => column.replace(`${field.key}.`, "")),
|
|
899
901
|
});
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
?
|
|
903
|
-
?
|
|
904
|
-
|
|
902
|
+
const formatLineContent = (lineContent) => Array.isArray(lineContent)
|
|
903
|
+
? lineContent.map((singleContent) => singleContent
|
|
904
|
+
? Array.isArray(singleContent)
|
|
905
|
+
? singleContent.map(formatLineContent)
|
|
906
|
+
: items
|
|
907
|
+
? items.find(({ id }) => singleContent === id)
|
|
905
908
|
: {
|
|
906
|
-
id:
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
909
|
+
id: singleContent,
|
|
910
|
+
}
|
|
911
|
+
: singleContent)
|
|
912
|
+
: (items?.find(({ id }) => lineContent === id) ?? {
|
|
913
|
+
id: lineContent,
|
|
914
|
+
});
|
|
915
|
+
for (const [lineNumber, lineContent] of searchableIDs.entries()) {
|
|
916
|
+
if (!lineContent)
|
|
917
|
+
continue;
|
|
918
|
+
RETURN[lineNumber][field.key] = formatLineContent(lineContent);
|
|
914
919
|
}
|
|
915
920
|
}
|
|
916
921
|
}
|
|
@@ -948,6 +953,8 @@ export default class Inibase {
|
|
|
948
953
|
let index = -1;
|
|
949
954
|
for await (const [key, value] of Object.entries(criteria)) {
|
|
950
955
|
const field = Utils.getField(key, globalConfig[this.databasePath].tables.get(tableName).schema);
|
|
956
|
+
if (!field)
|
|
957
|
+
continue;
|
|
951
958
|
index++;
|
|
952
959
|
let searchOperator = undefined;
|
|
953
960
|
let searchComparedAtValue = undefined;
|