inibase 1.1.13 → 1.1.15
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 +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -587,8 +587,8 @@ export default class Inibase {
|
|
|
587
587
|
return this.getDefaultValue({
|
|
588
588
|
...field,
|
|
589
589
|
type: field.type.sort((a, b) => Number(b === "array") - Number(a === "array") ||
|
|
590
|
-
Number(a === "
|
|
591
|
-
Number(a === "
|
|
590
|
+
Number(a === "number") - Number(b === "number") ||
|
|
591
|
+
Number(a === "string") - Number(b === "string"))[0],
|
|
592
592
|
});
|
|
593
593
|
switch (field.type) {
|
|
594
594
|
case "array":
|
|
@@ -889,7 +889,7 @@ export default class Inibase {
|
|
|
889
889
|
}
|
|
890
890
|
if (searchableIDs.size) {
|
|
891
891
|
const items = await this.get(field.table, isArrayField
|
|
892
|
-
? Array.from(new Set(Array.from(searchableIDs.values()).flat()))
|
|
892
|
+
? Array.from(new Set(Array.from(searchableIDs.values()).flat())).flat()
|
|
893
893
|
: Array.from(new Set(searchableIDs.values())), {
|
|
894
894
|
...options,
|
|
895
895
|
perPage: Number.POSITIVE_INFINITY,
|
|
@@ -900,7 +900,7 @@ export default class Inibase {
|
|
|
900
900
|
if (items) {
|
|
901
901
|
for (const [lineNumber, lineContent] of searchableIDs.entries()) {
|
|
902
902
|
const foundedItem = isArrayField
|
|
903
|
-
? items.filter(({ id }) =>
|
|
903
|
+
? lineContent.map((item) => items.filter(({ id }) => item.includes(id)))
|
|
904
904
|
: items.find(({ id }) => id === lineContent);
|
|
905
905
|
if (foundedItem)
|
|
906
906
|
RETURN[lineNumber][field.key] = foundedItem;
|