@anttiviljami/dtsgenerator
Advanced tools
Comparing version 3.19.2 to 3.19.3
@@ -72,12 +72,17 @@ "use strict"; | ||
Object.keys(b).forEach((key) => { | ||
var _a, _b; | ||
var _a, _b, _c, _d, _e, _f; | ||
const value = b[key]; | ||
if (a[key] != null && typeof value !== typeof a[key]) { | ||
if (a[key] != null && | ||
(typeof value !== typeof ((_a = a[key]) !== null && _a !== void 0 ? _a : {}) || | ||
Array.isArray(value) !== Array.isArray((_b = a[key]) !== null && _b !== void 0 ? _b : []))) { | ||
debug(`mergeSchema warning: type is mismatched, key=${key}`); | ||
} | ||
if (Array.isArray(value)) { | ||
a[key] = ((_a = a[key]) !== null && _a !== void 0 ? _a : []).concat(value); | ||
if (Array.isArray(value) && Array.isArray((_c = a[key]) !== null && _c !== void 0 ? _c : [])) { | ||
a[key] = ((_d = a[key]) !== null && _d !== void 0 ? _d : []).concat(value); | ||
} | ||
else if (value != null && typeof value === 'object') { | ||
(_b = a[key]) !== null && _b !== void 0 ? _b : (a[key] = {}); | ||
else if (value != null && | ||
typeof value === 'object' && | ||
!Array.isArray(value) && | ||
!Array.isArray((_e = a[key]) !== null && _e !== void 0 ? _e : {})) { | ||
(_f = a[key]) !== null && _f !== void 0 ? _f : (a[key] = {}); | ||
mergeSchema(a[key], value); | ||
@@ -84,0 +89,0 @@ } |
{ | ||
"name": "@anttiviljami/dtsgenerator", | ||
"version": "3.19.2", | ||
"version": "3.19.3", | ||
"description": "TypeScript d.ts file generator for JSON Schema file", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -89,9 +89,18 @@ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ | ||
const value = b[key]; | ||
if (a[key] != null && typeof value !== typeof a[key]) { | ||
if ( | ||
a[key] != null && | ||
(typeof value !== typeof (a[key] ?? {}) || | ||
Array.isArray(value) !== Array.isArray(a[key] ?? [])) | ||
) { | ||
debug(`mergeSchema warning: type is mismatched, key=${key}`); | ||
} | ||
if (Array.isArray(value)) { | ||
if (Array.isArray(value) && Array.isArray(a[key] ?? [])) { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call | ||
a[key] = (a[key] ?? []).concat(value); | ||
} else if (value != null && typeof value === 'object') { | ||
} else if ( | ||
value != null && | ||
typeof value === 'object' && | ||
!Array.isArray(value) && | ||
!Array.isArray(a[key] ?? {}) | ||
) { | ||
a[key] ??= {}; | ||
@@ -98,0 +107,0 @@ mergeSchema(a[key], value); |
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
382341
8487