@f5devcentral/f5-fast-core
Advanced tools
Comparing version 0.14.0 to 0.15.0
@@ -0,1 +1,5 @@ | ||
# v0.15.0 | ||
## Changed | ||
* template: Merge duplicate section definitions instead of overwriting | ||
# v0.14.0 | ||
@@ -2,0 +6,0 @@ ## Fixed |
@@ -410,4 +410,6 @@ /* Copyright 2021 F5 Networks, Inc. | ||
const defType = schemaDef.type || 'array'; | ||
const existingDef = acc.properties[defName] || {}; | ||
const newDef = Object.assign({ type: defType }, schemaDef); | ||
const asBool = defType === 'boolean' || defType === 'string'; | ||
if (defType === 'array') { | ||
@@ -427,2 +429,15 @@ newDef.items = newDef.items || {}; | ||
if (existingDef.type && existingDef.type !== defType) { | ||
throw new Error( | ||
`attempted to redefine ${defName} as ${defType} but it was already defined as ${existingDef.type}` | ||
); | ||
} | ||
if (existingDef.items && newDef.items && existingDef.items.type !== newDef.items.type) { | ||
throw new Error( | ||
`attempted to redefine ${defName}.items as ${newDef.items.type} but it` | ||
+ `was already defined as ${existingDef.items.type}` | ||
); | ||
} | ||
if (items.properties) { | ||
@@ -442,3 +457,6 @@ Object.keys(items.properties).forEach((item) => { | ||
acc.properties[defName] = Object.assign({}, newDef); | ||
acc.properties[defName] = deepmerge( | ||
existingDef, | ||
newDef | ||
); | ||
required.add(defName); | ||
@@ -445,0 +463,0 @@ |
{ | ||
"name": "@f5devcentral/f5-fast-core", | ||
"version": "0.14.0", | ||
"version": "0.15.0", | ||
"author": "F5 Networks", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121996
2446