json-schema-to-typescript
Advanced tools
Comparing version 2.0.0 to 2.0.1
// Generated by dts-bundle v0.5.0 | ||
export function compile(schema: JSONSchema.Schema, path: string, settings?: TsType.TsTypeSettings): string; | ||
export function compile(schema: JSONSchema.Schema, path: string | undefined, settings?: TsType.TsTypeSettings): string; | ||
export function compileFromFile(inputFilename: string): Promise<string | Error>; | ||
@@ -5,0 +5,0 @@ |
@@ -278,2 +278,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsonSchemaToTypescript = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
function Compiler(schema, filePath, settings) { | ||
if (filePath === void 0) { filePath = ''; } | ||
this.schema = schema; | ||
@@ -426,4 +427,4 @@ var path = path_1.resolve(filePath); | ||
.map(function (_) { return new TsTypes_1.TsType.EnumValue(_); }); | ||
// name our anonymous enum, if it doesn't have an ID, by the property name under | ||
// which it was declared. Failing both of these things, it'll concat together the | ||
// name our anonymous enum, if it doesn't have an ID, by the property name under | ||
// which it was declared. Failing both of these things, it'll concat together the | ||
// identifiers as EnumOneTwoThree for enum: ["One", "Two", "Three"]. Ugly, but | ||
@@ -430,0 +431,0 @@ // practical. |
{ | ||
"name": "json-schema-to-typescript", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "compile json schema to typescript typings", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -28,3 +28,7 @@ import { JSONSchema } from './JSONSchema' | ||
constructor(private schema: JSONSchema.Schema, filePath: string, settings?: TsType.TsTypeSettings) { | ||
constructor( | ||
private schema: JSONSchema.Schema, | ||
filePath: string | undefined = '', | ||
settings?: TsType.TsTypeSettings | ||
) { | ||
let path = resolve(filePath) | ||
@@ -198,4 +202,4 @@ this.filePath = parse(path) | ||
// name our anonymous enum, if it doesn't have an ID, by the property name under | ||
// which it was declared. Failing both of these things, it'll concat together the | ||
// name our anonymous enum, if it doesn't have an ID, by the property name under | ||
// which it was declared. Failing both of these things, it'll concat together the | ||
// identifiers as EnumOneTwoThree for enum: ["One", "Two", "Three"]. Ugly, but | ||
@@ -335,3 +339,7 @@ // practical. | ||
export function compile(schema: JSONSchema.Schema, path: string, settings?: TsType.TsTypeSettings): string { | ||
export function compile( | ||
schema: JSONSchema.Schema, | ||
path: string | undefined, | ||
settings?: TsType.TsTypeSettings | ||
): string { | ||
return new Compiler(schema, path, settings).toString() | ||
@@ -338,0 +346,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
84490
2318