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 2.0.0 to 2.0.1

2

dist/index.d.ts
// 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 @@ }

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