adaptic-backend 1.0.32 → 1.0.33
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/package.json +1 -1
- package/server/utils.d.ts.map +1 -1
- package/server/utils.js.map +1 -1
- package/server/utils.mjs +6 -3
- package/utils.js +6 -3
package/package.json
CHANGED
package/server/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CA4ClD"}
|
package/server/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB,CAAC,GAAQ;IAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG;aACP,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;aACvC,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB,CAAC,GAAQ;IAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG;aACP,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;aACvC,MAAM,CACL,IAAI,CAAC,EAAE,CACL,IAAI,KAAK,SAAS;YAClB,IAAI,KAAK,IAAI;YACb,CAAC,OAAO,IAAI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CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;IAED,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7D,CAAC"}
|
package/server/utils.mjs
CHANGED
|
@@ -2,12 +2,14 @@ export function removeUndefinedProps(obj) {
|
|
|
2
2
|
if (Array.isArray(obj)) {
|
|
3
3
|
return obj
|
|
4
4
|
.map(item => removeUndefinedProps(item))
|
|
5
|
-
.filter(item => item !== undefined &&
|
|
5
|
+
.filter(item => item !== undefined &&
|
|
6
|
+
item !== null &&
|
|
7
|
+
(typeof item !== 'object' || Object.keys(item).length > 0));
|
|
6
8
|
}
|
|
7
9
|
else if (typeof obj === 'object' && obj !== null) {
|
|
8
10
|
return Object.keys(obj).reduce((acc, key) => {
|
|
9
11
|
let value = obj[key];
|
|
10
|
-
if (value !== undefined) {
|
|
12
|
+
if (value !== undefined && value !== null) {
|
|
11
13
|
let cleanedValue;
|
|
12
14
|
if (key === 'where' && typeof value === 'object' && value !== null) {
|
|
13
15
|
if (value.hasOwnProperty('id') && value.id !== undefined) {
|
|
@@ -24,6 +26,7 @@ export function removeUndefinedProps(obj) {
|
|
|
24
26
|
cleanedValue = removeUndefinedProps(value);
|
|
25
27
|
}
|
|
26
28
|
if (cleanedValue !== undefined &&
|
|
29
|
+
cleanedValue !== null &&
|
|
27
30
|
(typeof cleanedValue !== 'object' || Object.keys(cleanedValue).length > 0)) {
|
|
28
31
|
acc[key] = cleanedValue;
|
|
29
32
|
}
|
|
@@ -31,6 +34,6 @@ export function removeUndefinedProps(obj) {
|
|
|
31
34
|
return acc;
|
|
32
35
|
}, {});
|
|
33
36
|
}
|
|
34
|
-
return obj !== undefined ? obj : undefined;
|
|
37
|
+
return obj !== undefined && obj !== null ? obj : undefined;
|
|
35
38
|
}
|
|
36
39
|
//# sourceMappingURL=utils.js.map
|
package/utils.js
CHANGED
|
@@ -5,12 +5,14 @@ function removeUndefinedProps(obj) {
|
|
|
5
5
|
if (Array.isArray(obj)) {
|
|
6
6
|
return obj
|
|
7
7
|
.map(item => removeUndefinedProps(item))
|
|
8
|
-
.filter(item => item !== undefined &&
|
|
8
|
+
.filter(item => item !== undefined &&
|
|
9
|
+
item !== null &&
|
|
10
|
+
(typeof item !== 'object' || Object.keys(item).length > 0));
|
|
9
11
|
}
|
|
10
12
|
else if (typeof obj === 'object' && obj !== null) {
|
|
11
13
|
return Object.keys(obj).reduce((acc, key) => {
|
|
12
14
|
let value = obj[key];
|
|
13
|
-
if (value !== undefined) {
|
|
15
|
+
if (value !== undefined && value !== null) {
|
|
14
16
|
let cleanedValue;
|
|
15
17
|
if (key === 'where' && typeof value === 'object' && value !== null) {
|
|
16
18
|
if (value.hasOwnProperty('id') && value.id !== undefined) {
|
|
@@ -27,6 +29,7 @@ function removeUndefinedProps(obj) {
|
|
|
27
29
|
cleanedValue = removeUndefinedProps(value);
|
|
28
30
|
}
|
|
29
31
|
if (cleanedValue !== undefined &&
|
|
32
|
+
cleanedValue !== null &&
|
|
30
33
|
(typeof cleanedValue !== 'object' || Object.keys(cleanedValue).length > 0)) {
|
|
31
34
|
acc[key] = cleanedValue;
|
|
32
35
|
}
|
|
@@ -34,6 +37,6 @@ function removeUndefinedProps(obj) {
|
|
|
34
37
|
return acc;
|
|
35
38
|
}, {});
|
|
36
39
|
}
|
|
37
|
-
return obj !== undefined ? obj : undefined;
|
|
40
|
+
return obj !== undefined && obj !== null ? obj : undefined;
|
|
38
41
|
}
|
|
39
42
|
//# sourceMappingURL=utils.js.map
|