json-schema-to-typescript
Advanced tools
Comparing version 10.1.1 to 10.1.2
@@ -80,3 +80,3 @@ "use strict"; | ||
function parseNonLiteral(schema, type, options, keyName, processed, usedNames) { | ||
var definitions = getDefinitions(JSONSchema_1.getRootSchema(schema)); // TODO | ||
var definitions = getDefinitionsMemoized(JSONSchema_1.getRootSchema(schema)); // TODO | ||
var keyNameFromDefinition = lodash_1.findKey(definitions, function (_) { return _ === schema; }); | ||
@@ -349,5 +349,2 @@ switch (type) { | ||
} | ||
/** | ||
* TODO: Memoize | ||
*/ | ||
function getDefinitions(schema, isSchema, processed) { | ||
@@ -368,2 +365,3 @@ if (isSchema === void 0) { isSchema = true; } | ||
} | ||
var getDefinitionsMemoized = lodash_1.memoize(getDefinitions); | ||
/** | ||
@@ -370,0 +368,0 @@ * TODO: Reduce rate of false positives |
{ | ||
"name": "json-schema-to-typescript", | ||
"version": "10.1.1", | ||
"version": "10.1.2", | ||
"description": "compile json schema to typescript typings", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
import {JSONSchema4Type, JSONSchema4TypeName} from 'json-schema' | ||
import {findKey, includes, isPlainObject, map, omit} from 'lodash' | ||
import {findKey, includes, isPlainObject, map, memoize, omit} from 'lodash' | ||
import {format} from 'util' | ||
@@ -122,3 +122,3 @@ import {Options} from './' | ||
): AST { | ||
const definitions = getDefinitions(getRootSchema(schema as any)) // TODO | ||
const definitions = getDefinitionsMemoized(getRootSchema(schema as any)) // TODO | ||
const keyNameFromDefinition = findKey(definitions, _ => _ === schema) | ||
@@ -437,5 +437,2 @@ | ||
/** | ||
* TODO: Memoize | ||
*/ | ||
function getDefinitions( | ||
@@ -474,2 +471,4 @@ schema: LinkedJSONSchema, | ||
const getDefinitionsMemoized = memoize(getDefinitions) | ||
/** | ||
@@ -476,0 +475,0 @@ * TODO: Reduce rate of false positives |
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
402290
4818