typedconverter
Advanced tools
Comparing version 1.0.0-alpha.4 to 1.0.0-alpha.5
@@ -1,2 +0,5 @@ | ||
declare type ConverterMap = [Function | string, Converter]; | ||
declare type ConverterMap = { | ||
type: Function | string; | ||
converter: Converter; | ||
}; | ||
interface ConversionIssue { | ||
@@ -3,0 +6,0 @@ path: string[]; |
@@ -170,2 +170,3 @@ "use strict"; | ||
const arrayConverter = (option.guessArrayElement ? DefaultConverters.friendlyArrayConverter : DefaultConverters.strictArrayConverter); | ||
const customConverters = (option.converters || []).map(x => [x.type, x.converter]); | ||
const mergedConverters = new Map([ | ||
@@ -177,3 +178,3 @@ [Number, DefaultConverters.numberConverter], | ||
["Model", DefaultConverters.modelConverter], | ||
...option.converters || [] | ||
...customConverters | ||
]); | ||
@@ -180,0 +181,0 @@ const [val, err] = convert(value, { path, expectedType: type || option.type, converters: mergedConverters }); |
{ | ||
"name": "typedconverter", | ||
"version": "1.0.0-alpha.4", | ||
"version": "1.0.0-alpha.5", | ||
"description": "Convert object into classes match with TypeScript type annotation", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
17745
292
0