@json-layout/vocabulary 2.5.0 → 2.6.0
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/src/normalize.js +4 -1
- package/types/normalize.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@json-layout/vocabulary",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Main JSON Layout vocabulary as JSON schemas and Typescript types. Also contains some small utility functions to validate and normalize annotations.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
package/src/normalize.js
CHANGED
|
@@ -673,9 +673,12 @@ function getNormalizedLayout (key, layoutKeyword, schemaFragment, type, nullable
|
|
|
673
673
|
if (!switchCases.find(s => !s.if)) {
|
|
674
674
|
switchCases.push({})
|
|
675
675
|
}
|
|
676
|
+
/** @type {LayoutKeyword} */
|
|
677
|
+
const extraProps = { ...layoutKeyword }
|
|
678
|
+
delete extraProps.switch
|
|
676
679
|
for (let i = 0; i < switchCases.length; i++) {
|
|
677
680
|
const switchCase = switchCases[i]
|
|
678
|
-
const compObjectResult = getCompObject(key, switchCase, schemaFragment, type, nullable, schemaPath, options, schemaChild)
|
|
681
|
+
const compObjectResult = getCompObject(key, { ...extraProps, ...getPartialCompObject(switchCase) }, schemaFragment, type, nullable, schemaPath, options, schemaChild)
|
|
679
682
|
normalizedSwitchCases.push(compObjectResult)
|
|
680
683
|
}
|
|
681
684
|
return { switch: normalizedSwitchCases }
|
package/types/normalize.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.js"],"names":[],"mappings":"AAsvBA;;;;;;;;;GASG;AACH,6CATW,MAAM,GAAG,MAAM,kBACf,cAAc,cACd,MAAM,WACL,OAAO,YAAY,EAAE,gBAAgB,gBACtC,OAAO,GAAG,mBAAmB,cAC7B,MAAM,GAAG,SAAS,kBAClB,OAAO,GACL;IAAC,MAAM,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAC,CAwBxD;;;AAreM,uDAHI,cAAc,GACZ,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG,SAAS,CA6BhD;AAMM,sDAHI,cAAc,GACZ;IAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAC,CAkCzD;+BAxWY,OAAO,YAAY,EAAE,gBAAgB;gCACrC,OAAO,YAAY,EAAE,iBAAiB;oBACtC,OAAO,YAAY,EAAE,KAAK;uBAC1B,OAAO,YAAY,EAAE,QAAQ;6BAC7B,OAAO,YAAY,EAAE,cAAc;yBACnC,OAAO,YAAY,EAAE,UAAU;+BAC/B,OAAO,YAAY,EAAE,gBAAgB;4BACrC,OAAO,YAAY,EAAE,aAAa;8BAClC,OAAO,YAAY,EAAE,eAAe;gCACpC,OAAO,YAAY,EAAE,iBAAiB;6BACtC,OAAO,YAAY,EAAE,cAAc"}
|