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 10.0.3 to 10.1.0

4

CHANGELOG.md

@@ -5,2 +5,6 @@ # Changelog

## 10.1.0
- ec78099 Feat: Add support for JSON Schema `const` and `$defs` keywords (#263)
## 10.0.0

@@ -7,0 +11,0 @@

@@ -115,2 +115,14 @@ "use strict";

});
rules.set('Transform $defs to definitions', function (schema) {
if (schema.$defs) {
schema.definitions = schema.$defs;
delete schema.$defs;
}
});
rules.set('Transform const to singleton enum', function (schema) {
if (schema.const) {
schema.enum = [schema.const];
delete schema.const;
}
});
function normalize(rootSchema, filename, options) {

@@ -117,0 +129,0 @@ rules.forEach(function (rule) { return utils_1.traverse(rootSchema, function (schema) { return rule(schema, filename, options); }); });

2

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

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

@@ -134,2 +134,16 @@ import {JSONSchemaTypeName, LinkedJSONSchema, NormalizedJSONSchema, Parent} from './types/JSONSchema'

rules.set('Transform $defs to definitions', schema => {
if (schema.$defs) {
schema.definitions = schema.$defs
delete schema.$defs
}
})
rules.set('Transform const to singleton enum', schema => {
if (schema.const) {
schema.enum = [schema.const]
delete schema.const
}
})
export function normalize(rootSchema: LinkedJSONSchema, filename: string, options: Options): NormalizedJSONSchema {

@@ -136,0 +150,0 @@ rules.forEach(rule => traverse(rootSchema, schema => rule(schema, filename, options)))

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