typedconverter
Advanced tools
Comparing version 1.0.0-alpha.7 to 1.0.0-alpha.8
@@ -14,2 +14,3 @@ declare type Converter = (value: any, info: ObjectInfo<Function | Function[]>) => Promise<ConversionResult>; | ||
decorators?: any[]; | ||
errorStatus?: number; | ||
} | ||
@@ -16,0 +17,0 @@ interface ConverterMap { |
@@ -247,6 +247,6 @@ "use strict"; | ||
{ path: [], decorators: [], type: option } : !!option ? option : { path: [], decorators: [], type: undefined }; | ||
const { type = factoryOption.type, path = [], decorators = [] } = opt, restOpt = tslib_1.__rest(opt, ["type", "path", "decorators"]); | ||
const { type = factoryOption.type, path = [], decorators = [], errorStatus = 400 } = opt, restOpt = tslib_1.__rest(opt, ["type", "path", "decorators", "errorStatus"]); | ||
const result = await convert(value, Object.assign({ visitors: factoryOption.visitors || [], converters: mergedConverters, path, type, decorators }, restOpt)); | ||
if (result.messages.length > 0) | ||
throw new ConversionError(result.messages); | ||
throw new ConversionError(result.messages, errorStatus); | ||
else | ||
@@ -253,0 +253,0 @@ return result.value; |
{ | ||
"name": "typedconverter", | ||
"version": "1.0.0-alpha.7", | ||
"version": "1.0.0-alpha.8", | ||
"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
22847
390