Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@anttiviljami/dtsgenerator

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anttiviljami/dtsgenerator - npm Package Compare versions

Comparing version 3.19.2 to 3.19.3

17

dist/core/utils.js

@@ -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);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc