@appsemble/node-utils 0.32.2-test.1 → 0.32.2-test.3
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 +3 -3
- package/package.json +3 -3
- package/resource.js +5 -2
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#  Appsemble Node Utilities
|
|
2
2
|
|
|
3
3
|
> NodeJS utilities used by Appsemble internally.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@appsemble/node-utils)
|
|
6
|
-
[](https://gitlab.com/appsemble/appsemble/-/releases/0.32.2-test.3)
|
|
7
7
|
[](https://prettier.io)
|
|
8
8
|
|
|
9
9
|
## Table of Contents
|
|
@@ -26,5 +26,5 @@ compatibility is not guaranteed.
|
|
|
26
26
|
|
|
27
27
|
## License
|
|
28
28
|
|
|
29
|
-
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.32.2-test.
|
|
29
|
+
[LGPL-3.0-only](https://gitlab.com/appsemble/appsemble/-/blob/0.32.2-test.3/LICENSE.md) ©
|
|
30
30
|
[Appsemble](https://appsemble.com)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appsemble/node-utils",
|
|
3
|
-
"version": "0.32.2-test.
|
|
3
|
+
"version": "0.32.2-test.3",
|
|
4
4
|
"description": "NodeJS utilities used by Appsemble internally.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"test": "vitest"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@appsemble/types": "0.32.2-test.
|
|
44
|
-
"@appsemble/utils": "0.32.2-test.
|
|
43
|
+
"@appsemble/types": "0.32.2-test.3",
|
|
44
|
+
"@appsemble/utils": "0.32.2-test.3",
|
|
45
45
|
"@formatjs/fast-memoize": "^2.0.0",
|
|
46
46
|
"@fortawesome/fontawesome-free": "^6.0.0",
|
|
47
47
|
"@kubernetes/client-node": "^0.22.2",
|
package/resource.js
CHANGED
|
@@ -222,7 +222,7 @@ export function processResourceBody(ctx, definition, knownAssetIds = [], knownEx
|
|
|
222
222
|
base: '#',
|
|
223
223
|
preValidateProperty,
|
|
224
224
|
nestedErrors: true,
|
|
225
|
-
rewrite(value, { format }, options, { path }) {
|
|
225
|
+
rewrite(value, { format, oneOf }, options, { path }) {
|
|
226
226
|
let propertyName;
|
|
227
227
|
if (Array.isArray(resource) && path.length === 2 && typeof path[0] === 'number') {
|
|
228
228
|
propertyName = path[1];
|
|
@@ -260,12 +260,15 @@ export function processResourceBody(ctx, definition, knownAssetIds = [], knownEx
|
|
|
260
260
|
}
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
|
-
if (format !== 'binary') {
|
|
263
|
+
if (format !== 'binary' && !oneOf?.some((s) => s.format === 'binary')) {
|
|
264
264
|
return value;
|
|
265
265
|
}
|
|
266
266
|
if (knownAssetIds.includes(value)) {
|
|
267
267
|
return value;
|
|
268
268
|
}
|
|
269
|
+
if (value == null) {
|
|
270
|
+
return value;
|
|
271
|
+
}
|
|
269
272
|
const num = Number(value);
|
|
270
273
|
if (!assetIdMap.has(num)) {
|
|
271
274
|
return value;
|