typedconverter
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -62,4 +62,4 @@ import validatorJs from "validator"; | ||
function mimeType(opt?: Opt): (target: any, name: string, index?: any) => void; | ||
function mobilePhone(opt: Opt & { | ||
locale: validatorJs.MobilePhoneLocale; | ||
function mobilePhone(opt?: Opt & { | ||
locale?: validatorJs.MobilePhoneLocale; | ||
options?: validatorJs.IsMobilePhoneOptions; | ||
@@ -71,4 +71,4 @@ }): (target: any, name: string, index?: any) => void; | ||
function port(opt?: Opt): (target: any, name: string, index?: any) => void; | ||
function postalCode(opt: Opt & { | ||
locale: validatorJs.PostalCodeLocale; | ||
function postalCode(opt?: Opt & { | ||
locale?: validatorJs.PostalCodeLocale; | ||
}): (target: any, name: string, index?: any) => void; | ||
@@ -75,0 +75,0 @@ function surrogatePair(opt?: Opt): (target: any, name: string, index?: any) => void; |
@@ -156,3 +156,3 @@ "use strict"; | ||
function mobilePhone(opt) { | ||
return check(x => validator_1.default.isMobilePhone(x, opt.locale, opt && opt.options), opt && opt.message || "Invalid mobile phone"); | ||
return check(x => validator_1.default.isMobilePhone(x, opt && opt.locale, opt && opt.options), opt && opt.message || "Invalid mobile phone"); | ||
} | ||
@@ -177,3 +177,3 @@ val.mobilePhone = mobilePhone; | ||
function postalCode(opt) { | ||
return check(x => validator_1.default.isPostalCode(x, opt.locale), opt && opt.message || "Invalid postal code"); | ||
return check(x => validator_1.default.isPostalCode(x, opt && opt.locale || "any"), opt && opt.message || "Invalid postal code"); | ||
} | ||
@@ -180,0 +180,0 @@ val.postalCode = postalCode; |
{ | ||
"name": "typedconverter", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Convert object into classes match with TypeScript type annotation", | ||
@@ -28,3 +28,3 @@ "main": "lib/index.js", | ||
"@types/ejs": "^3.0.0", | ||
"@types/jest": "^24.0.23", | ||
"@types/jest": "^24.0.25", | ||
"@types/joi": "^14.3.4", | ||
@@ -35,5 +35,5 @@ "coveralls": "^3.0.9", | ||
"joi": "^14.3.1", | ||
"ts-jest": "^24.2.0", | ||
"ts-node": "^8.5.4", | ||
"typescript": "^3.7.3" | ||
"ts-jest": "^24.3.0", | ||
"ts-node": "^8.6.1", | ||
"typescript": "^3.7.4" | ||
}, | ||
@@ -40,0 +40,0 @@ "bugs": { |
38774