@sprucelabs/schema 32.0.35 → 32.0.37
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.
|
@@ -22,9 +22,10 @@ class SpruceError extends error_1.default {
|
|
|
22
22
|
case 'TRANSFORMATION_ERROR':
|
|
23
23
|
message = '';
|
|
24
24
|
options.errors?.forEach((error) => {
|
|
25
|
-
message += `Error
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
message += `Error transforming '${error.name}':\n`;
|
|
26
|
+
const m = error.friendlyMessage || error.originalError?.message;
|
|
27
|
+
if (m) {
|
|
28
|
+
message += ` - ${m}`;
|
|
28
29
|
}
|
|
29
30
|
});
|
|
30
31
|
if (message === '') {
|
|
@@ -18,9 +18,11 @@ export default class SpruceError extends AbstractSpruceError {
|
|
|
18
18
|
case 'TRANSFORMATION_ERROR':
|
|
19
19
|
message = '';
|
|
20
20
|
(_a = options.errors) === null || _a === void 0 ? void 0 : _a.forEach((error) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
var _a;
|
|
22
|
+
message += `Error transforming '${error.name}':\n`;
|
|
23
|
+
const m = error.friendlyMessage || ((_a = error.originalError) === null || _a === void 0 ? void 0 : _a.message);
|
|
24
|
+
if (m) {
|
|
25
|
+
message += ` - ${m}`;
|
|
24
26
|
}
|
|
25
27
|
});
|
|
26
28
|
if (message === '') {
|
|
@@ -47,8 +47,8 @@ export default function normalizeFieldValue(schemaId, schemaName, schemasById, f
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
if (localValue.length > 0) {
|
|
50
|
-
localValue = localValue.map((value) => typeof value === 'undefined'
|
|
51
|
-
?
|
|
50
|
+
localValue = localValue.map((value) => typeof value === 'undefined' || value === null
|
|
51
|
+
? value
|
|
52
52
|
: field.toValueType(value, {
|
|
53
53
|
createEntityInstances,
|
|
54
54
|
...baseOptions,
|
|
@@ -53,8 +53,8 @@ function normalizeFieldValue(schemaId, schemaName, schemasById, field, value, op
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
if (localValue.length > 0) {
|
|
56
|
-
localValue = localValue.map((value) => typeof value === 'undefined'
|
|
57
|
-
?
|
|
56
|
+
localValue = localValue.map((value) => typeof value === 'undefined' || value === null
|
|
57
|
+
? value
|
|
58
58
|
: field.toValueType(value, {
|
|
59
59
|
createEntityInstances,
|
|
60
60
|
...baseOptions,
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"!build/__tests__",
|
|
9
9
|
"esm"
|
|
10
10
|
],
|
|
11
|
-
"version": "32.0.
|
|
11
|
+
"version": "32.0.37",
|
|
12
12
|
"main": "./build/index.js",
|
|
13
13
|
"types": "./build/index.d.ts",
|
|
14
14
|
"module": "./build/esm/index.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@sprucelabs/error": "^7.0.23",
|
|
62
|
-
"@sprucelabs/test-utils": "^6.0.
|
|
62
|
+
"@sprucelabs/test-utils": "^6.0.35",
|
|
63
63
|
"email-validator": "^2.0.4",
|
|
64
64
|
"just-safe-get": "^4.2.0",
|
|
65
65
|
"just-safe-set": "^4.2.1"
|