json-schema-to-typescript
Advanced tools
Comparing version 13.0.1 to 13.0.2
@@ -41,3 +41,3 @@ #!/usr/bin/env node | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (g && (g = 0, op[0] && (_ = 0)), _) try { | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
@@ -44,0 +44,0 @@ if (y = 0, t) op = [op[0] & 2, t.value]; |
@@ -43,3 +43,3 @@ "use strict"; | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (g && (g = 0, op[0] && (_ = 0)), _) try { | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
@@ -46,0 +46,0 @@ if (y = 0, t) op = [op[0] & 2, t.value]; |
@@ -5,4 +5,4 @@ import { JSONSchema4Type } from 'json-schema'; | ||
import { JSONSchema as LinkedJSONSchema, SchemaType } from './types/JSONSchema'; | ||
export type Processed = Map<LinkedJSONSchema, Map<SchemaType, AST>>; | ||
export type UsedNames = Set<string>; | ||
export declare type Processed = Map<LinkedJSONSchema, Map<SchemaType, AST>>; | ||
export declare type UsedNames = Set<string>; | ||
export declare function parse(schema: LinkedJSONSchema | JSONSchema4Type, options: Options, keyName?: string, processed?: Processed, usedNames?: Set<string>): AST; |
@@ -216,3 +216,3 @@ "use strict"; | ||
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames), | ||
params: parse(schema.items, options, undefined, processed, usedNames), | ||
params: parse(schema.items, options, "{keyNameFromDefinition}Items", processed, usedNames), | ||
type: 'ARRAY' | ||
@@ -219,0 +219,0 @@ }; |
import $RefParser = require('@bcherny/json-schema-ref-parser'); | ||
import { JSONSchema } from './types/JSONSchema'; | ||
export type DereferencedPaths = WeakMap<$RefParser.JSONSchemaObject, string>; | ||
export declare type DereferencedPaths = WeakMap<$RefParser.JSONSchemaObject, string>; | ||
export declare function dereference(schema: JSONSchema, { cwd, $refOptions }: { | ||
@@ -5,0 +5,0 @@ cwd: string; |
@@ -28,3 +28,3 @@ "use strict"; | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (g && (g = 0, op[0] && (_ = 0)), _) try { | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
@@ -31,0 +31,0 @@ if (y = 0, t) op = [op[0] & 2, t.value]; |
import { JSONSchema4Type } from 'json-schema'; | ||
export type AST_TYPE = AST['type']; | ||
export type AST = TAny | TArray | TBoolean | TEnum | TInterface | TNamedInterface | TIntersection | TLiteral | TNever | TNumber | TNull | TObject | TReference | TString | TTuple | TUnion | TUnknown | TCustomType; | ||
export declare type AST_TYPE = AST['type']; | ||
export declare type AST = TAny | TArray | TBoolean | TEnum | TInterface | TNamedInterface | TIntersection | TLiteral | TNever | TNumber | TNull | TObject | TReference | TString | TTuple | TUnion | TUnknown | TCustomType; | ||
export interface AbstractAST { | ||
@@ -10,9 +10,9 @@ comment?: string; | ||
} | ||
export type ASTWithComment = AST & { | ||
export declare type ASTWithComment = AST & { | ||
comment: string; | ||
}; | ||
export type ASTWithName = AST & { | ||
export declare type ASTWithName = AST & { | ||
keyName: string; | ||
}; | ||
export type ASTWithStandaloneName = AST & { | ||
export declare type ASTWithStandaloneName = AST & { | ||
standaloneName: string; | ||
@@ -19,0 +19,0 @@ }; |
/// <reference types="lodash" /> | ||
import { JSONSchema4, JSONSchema4Type, JSONSchema4TypeName } from 'json-schema'; | ||
export type SchemaType = 'ALL_OF' | 'UNNAMED_SCHEMA' | 'ANY' | 'ANY_OF' | 'BOOLEAN' | 'NAMED_ENUM' | 'NAMED_SCHEMA' | 'NEVER' | 'NULL' | 'NUMBER' | 'STRING' | 'OBJECT' | 'ONE_OF' | 'TYPED_ARRAY' | 'REFERENCE' | 'UNION' | 'UNNAMED_ENUM' | 'UNTYPED_ARRAY' | 'CUSTOM_TYPE'; | ||
export type JSONSchemaTypeName = JSONSchema4TypeName; | ||
export type JSONSchemaType = JSONSchema4Type; | ||
export declare type SchemaType = 'ALL_OF' | 'UNNAMED_SCHEMA' | 'ANY' | 'ANY_OF' | 'BOOLEAN' | 'NAMED_ENUM' | 'NAMED_SCHEMA' | 'NEVER' | 'NULL' | 'NUMBER' | 'STRING' | 'OBJECT' | 'ONE_OF' | 'TYPED_ARRAY' | 'REFERENCE' | 'UNION' | 'UNNAMED_ENUM' | 'UNTYPED_ARRAY' | 'CUSTOM_TYPE'; | ||
export declare type JSONSchemaTypeName = JSONSchema4TypeName; | ||
export declare type JSONSchemaType = JSONSchema4Type; | ||
export interface JSONSchema extends JSONSchema4 { | ||
@@ -7,0 +7,0 @@ /** |
@@ -19,3 +19,3 @@ import { JSONSchema, LinkedJSONSchema } from './types/JSONSchema'; | ||
export declare function error(...messages: any[]): void; | ||
type LogStyle = 'blue' | 'cyan' | 'green' | 'magenta' | 'red' | 'white' | 'yellow'; | ||
declare type LogStyle = 'blue' | 'cyan' | 'green' | 'magenta' | 'red' | 'white' | 'yellow'; | ||
export declare function log(style: LogStyle, title: string, ...messages: unknown[]): void; | ||
@@ -22,0 +22,0 @@ /** |
{ | ||
"name": "json-schema-to-typescript", | ||
"version": "13.0.1", | ||
"version": "13.0.2", | ||
"description": "compile json schema to typescript typings", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -266,3 +266,3 @@ import {JSONSchema4Type, JSONSchema4TypeName} from 'json-schema' | ||
standaloneName: standaloneName(schema, keyNameFromDefinition, usedNames), | ||
params: parse(schema.items!, options, undefined, processed, usedNames), | ||
params: parse(schema.items!, options, `{keyNameFromDefinition}Items`, processed, usedNames), | ||
type: 'ARRAY' | ||
@@ -269,0 +269,0 @@ } |
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
2799174
57