@hoth/typescript-to-json-schema
Advanced tools
Comparing version 1.0.12 to 1.0.13
@@ -78,2 +78,12 @@ "use strict"; | ||
} | ||
for (const key in element) { | ||
if (ret.hasOwnProperty(key)) { | ||
if (lodash_1.isPlainObject(element[key])) { | ||
ret[key] = walk(element[key], id, schemas); | ||
} | ||
if (lodash_1.isArray(element[key]) && ['oneOf', 'anyOf', 'allOf', 'items'].includes(key)) { | ||
ret[key] = element[key].map(e => lodash_1.isPlainObject(e) && walk(e, id, schemas)); | ||
} | ||
} | ||
} | ||
if (element.anyOf && mergeAnyOf) { | ||
@@ -95,16 +105,7 @@ ret = mergeSchema(lodash_1.omit(ret, 'anyOf'), walk(element.anyOf[0], id, schemas)); | ||
const allOfArray = [...ret.allOf]; | ||
for (const item of allOfArray) { | ||
ret = mergeSchema(ret, walk(item, id, schemas)); | ||
} | ||
ret = lodash_1.omit(ret, 'allOf'); | ||
} | ||
} | ||
for (const key in element) { | ||
if (ret.hasOwnProperty(key)) { | ||
if (lodash_1.isPlainObject(element[key])) { | ||
ret[key] = walk(element[key], id, schemas); | ||
for (let item of allOfArray) { | ||
item = walk(item, id, schemas); | ||
ret = mergeSchema(ret, item); | ||
} | ||
if (lodash_1.isArray(element[key]) && ['oneOf', 'anyOf', 'allOf', 'items'].includes(key)) { | ||
ret[key] = element[key].map(e => lodash_1.isPlainObject(e) && walk(e, id, schemas)); | ||
} | ||
} | ||
@@ -111,0 +112,0 @@ } |
{ | ||
"name": "@hoth/typescript-to-json-schema", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "typescript to json-schema transpiler", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
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
35067
410