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

ts-json-schema-generator

Package Overview
Dependencies
Maintainers
3
Versions
335
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-json-schema-generator - npm Package Compare versions

Comparing version 2.1.1--canary.1933.47af8b9.0 to 2.1.1--canary.1933.481e7cf.0

2

dist/package.json
{
"name": "ts-json-schema-generator",
"version": "2.1.1--canary.1933.47af8b9.0",
"version": "2.1.1--canary.1933.481e7cf.0",
"description": "Generate JSON schema from your Typescript sources",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -19,2 +19,3 @@ import ts from "typescript";

import { removeUndefined } from "../Utils/removeUndefined.js";
import { uniqueTypeArray } from "../Utils/uniqueTypeArray.js";
export class MappedTypeNodeParser {

@@ -80,8 +81,6 @@ childNodeParser;

}
const key = derefType(this.childNodeParser.createType(node.nameType, this.createSubContext(node, rawKey, context)));
return key;
return derefType(this.childNodeParser.createType(node.nameType, this.createSubContext(node, rawKey, context)));
}
getProperties(node, keyListType, context) {
return keyListType
.getFlattenedTypes(derefType)
return uniqueTypeArray(keyListType.getFlattenedTypes(derefType))
.filter((type) => type instanceof LiteralType)

@@ -88,0 +87,0 @@ .map((type) => [type, this.mapKey(node, type, context)])

{
"name": "ts-json-schema-generator",
"version": "2.1.1--canary.1933.47af8b9.0",
"version": "2.1.1--canary.1933.481e7cf.0",
"description": "Generate JSON schema from your Typescript sources",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -21,2 +21,3 @@ import ts from "typescript";

import { removeUndefined } from "../Utils/removeUndefined.js";
import { uniqueTypeArray } from "../Utils/uniqueTypeArray.js";

@@ -98,12 +99,7 @@ export class MappedTypeNodeParser implements SubNodeParser {

}
const key = derefType(
this.childNodeParser.createType(node.nameType, this.createSubContext(node, rawKey, context)),
);
return key;
return derefType(this.childNodeParser.createType(node.nameType, this.createSubContext(node, rawKey, context)));
}
protected getProperties(node: ts.MappedTypeNode, keyListType: UnionType, context: Context): ObjectProperty[] {
return keyListType
.getFlattenedTypes(derefType)
return uniqueTypeArray(keyListType.getFlattenedTypes(derefType))
.filter((type): type is LiteralType => type instanceof LiteralType)

@@ -110,0 +106,0 @@ .map((type) => [type, this.mapKey(node, type, context)])

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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