Socket
Socket
Sign inDemoInstall

json-schema-to-typescript

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-to-typescript - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

test/cases/named-property.ts

2

package.json
{
"name": "json-schema-to-typescript",
"version": "1.2.1",
"version": "1.2.2",
"description": "compile json schema to typescript typings",

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

@@ -168,3 +168,8 @@ import { JSONSchema } from './JSONSchema'

let type = this.createTsType(rule)
type.id = type.id || rule.id || rule.title
if (!type.id) {
// the type is not declared, let's check if we should declare it or keep it inline
type.id = rule.id || rule.title
if (type.id)
this.declareType(type, type.id, type.id)
}
type.description = type.description || rule.description

@@ -171,0 +176,0 @@ return type

@@ -150,3 +150,3 @@ import { camelCase, upperFirst } from 'lodash'

decl += ';'
if (settings.propertyDescription && _.type.description)
if (settings.propertyDescription && _.type.description && !_.type.id)
decl += ' // ' + _.type.description

@@ -153,0 +153,0 @@ return decl

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