inibase 1.1.9 → 1.1.10
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 +6 -2
- package/dist/utils.js +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -476,7 +476,11 @@ export default class Inibase {
|
|
|
476
476
|
? value
|
|
477
477
|
: UtilsServer.hashPassword(String(value));
|
|
478
478
|
case "number":
|
|
479
|
-
return Utils.isNumber(value)
|
|
479
|
+
return Utils.isNumber(value)
|
|
480
|
+
? typeof value === "number"
|
|
481
|
+
? value
|
|
482
|
+
: Number(value.trim())
|
|
483
|
+
: 0;
|
|
480
484
|
case "id":
|
|
481
485
|
return Utils.isNumber(value)
|
|
482
486
|
? value
|
|
@@ -840,7 +844,7 @@ export default class Inibase {
|
|
|
840
844
|
if (!RETURN[index])
|
|
841
845
|
RETURN[index] = {};
|
|
842
846
|
if (Utils.isObject(item)) {
|
|
843
|
-
if (!Object.values(item).every((i) => i === null))
|
|
847
|
+
if (!Object.values(item).every((i) => i === null || i === 0))
|
|
844
848
|
RETURN[index][field.key] = item;
|
|
845
849
|
}
|
|
846
850
|
}
|
package/dist/utils.js
CHANGED
|
@@ -25,7 +25,9 @@ export const isArrayOfArrays = (input) => Array.isArray(input) && input.length >
|
|
|
25
25
|
* Note: Recursively checks each element, allowing for nested arrays of nulls.
|
|
26
26
|
*/
|
|
27
27
|
export const isArrayOfNulls = (input) => Array.isArray(input) &&
|
|
28
|
-
input.every((_input) => Array.isArray(_input)
|
|
28
|
+
input.every((_input) => Array.isArray(_input)
|
|
29
|
+
? isArrayOfNulls(_input)
|
|
30
|
+
: _input === null || _input === 0 || _input === undefined);
|
|
29
31
|
/**
|
|
30
32
|
* Type guard function to check if the input is an object.
|
|
31
33
|
*
|