inibase 1.0.0-rc.109 → 1.0.0-rc.110
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/README.md +1 -0
- package/dist/index.js +3 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -726,6 +726,7 @@ await db.get("user", undefined, { sort: {age: -1, username: "asc"} });
|
|
|
726
726
|
- [x] Id
|
|
727
727
|
- [x] JSON
|
|
728
728
|
- [ ] TO-DO:
|
|
729
|
+
- [ ] Use new Map() instead of Object
|
|
729
730
|
- [ ] Ability to search in JSON fields
|
|
730
731
|
- [ ] Re-check used exec functions
|
|
731
732
|
- [ ] Use smart caching (based on N° of queries)
|
package/dist/index.js
CHANGED
|
@@ -414,17 +414,16 @@ export default class Inibase {
|
|
|
414
414
|
if (Utils.isArrayOfObjects(data))
|
|
415
415
|
return data.map((single_data) => this.formatData(single_data, schema, formatOnlyAvailiableKeys));
|
|
416
416
|
if (Utils.isObject(data)) {
|
|
417
|
-
const RETURN = {};
|
|
418
417
|
for (const field of schema) {
|
|
419
418
|
if (!Object.hasOwn(data, field.key)) {
|
|
420
419
|
if (formatOnlyAvailiableKeys)
|
|
421
420
|
continue;
|
|
422
|
-
|
|
421
|
+
data[field.key] = this.getDefaultValue(field);
|
|
423
422
|
continue;
|
|
424
423
|
}
|
|
425
|
-
|
|
424
|
+
data[field.key] = this.formatField(data[field.key], field.type, field.children, formatOnlyAvailiableKeys);
|
|
426
425
|
}
|
|
427
|
-
return
|
|
426
|
+
return data;
|
|
428
427
|
}
|
|
429
428
|
return [];
|
|
430
429
|
}
|