inibase 1.0.0-rc.42 → 1.0.0-rc.44

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.
Files changed (2) hide show
  1. package/dist/index.js +14 -9
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -417,16 +417,21 @@ export default class Inibase {
417
417
  if (!RETURN[index])
418
418
  RETURN[index] = {};
419
419
  if (Utils.isObject(item)) {
420
- if (!Object.values(item).every((i) => i === null)) {
421
- if (RETURN[index][field.key]) {
420
+ if (!Utils.isArrayOfNulls(Object.values(item))) {
421
+ if (RETURN[index][field.key])
422
422
  Object.entries(item).forEach(([key, value], _index) => {
423
- RETURN[index][field.key] = RETURN[index][field.key].map((_obj, _i) => ({
424
- ..._obj,
425
- [key]: value[_i],
426
- }));
423
+ for (let _index = 0; _index < value.length; _index++)
424
+ if (RETURN[index][field.key][_index])
425
+ Object.assign(RETURN[index][field.key][_index], {
426
+ [key]: value[_index],
427
+ });
428
+ else
429
+ RETURN[index][field.key][_index] = {
430
+ [key]: value[_index],
431
+ };
427
432
  });
428
- }
429
- else if (Object.values(item).every((_i) => Utils.isArrayOfArrays(_i) || Array.isArray(_i)))
433
+ else if (Object.values(item).every((_i) => Utils.isArrayOfArrays(_i) || Array.isArray(_i)) &&
434
+ prefix)
430
435
  RETURN[index][field.key] = item;
431
436
  else {
432
437
  RETURN[index][field.key] = [];
@@ -434,7 +439,7 @@ export default class Inibase {
434
439
  for (let _i = 0; _i < value.length; _i++) {
435
440
  if (value[_i] === null ||
436
441
  (Array.isArray(value[_i]) &&
437
- value[_i].every((_item) => _item === null)))
442
+ Utils.isArrayOfNulls(value[_i])))
438
443
  continue;
439
444
  if (!RETURN[index][field.key][_i])
440
445
  RETURN[index][field.key][_i] = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inibase",
3
- "version": "1.0.0-rc.42",
3
+ "version": "1.0.0-rc.44",
4
4
  "author": {
5
5
  "name": "Karim Amahtil",
6
6
  "email": "karim.amahtil@gmail.com"
@@ -82,7 +82,7 @@
82
82
  "typescript": "^5.3.3"
83
83
  },
84
84
  "dependencies": {
85
- "inison": "1.0.0-rc.1"
85
+ "inison": "^1.0.0-rc.2"
86
86
  },
87
87
  "scripts": {
88
88
  "build": "npx tsc",