express-validator
Advanced tools
Comparing version 6.3.1 to 6.4.0
@@ -8,2 +8,6 @@ --- | ||
> These sanitization-only middlewares have been deprecated, as the [validation ones](api-check.md) | ||
offer the same functionality, and much more. | ||
> They will be removed eventually. | ||
## `sanitize(fields)` | ||
@@ -10,0 +14,0 @@ - `field`: a string or an array of strings of field names to validate against. |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "6.3.1", | ||
"version": "6.4.0", | ||
"homepage": "https://express-validator.github.io", | ||
@@ -38,3 +38,3 @@ "license": "MIT", | ||
"report-coverage": "cat coverage/lcov.info | coveralls", | ||
"version": "npm run docs:version -- $npm_package_version && git add -A website" | ||
"version": "npm run docs:version -- $npm_package_version && npm run docs:build && git add -A website" | ||
}, | ||
@@ -46,19 +46,19 @@ "engines": { | ||
"lodash": "^4.17.15", | ||
"validator": "^11.1.0" | ||
"validator": "^12.1.0" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^24.0.15", | ||
"@types/lodash": "^4.14.136", | ||
"@types/jest": "^24.9.1", | ||
"@types/lodash": "^4.14.149", | ||
"@typescript-eslint/eslint-plugin": "^1.13.0", | ||
"@typescript-eslint/parser": "^1.13.0", | ||
"coveralls": "^3.0.5", | ||
"docusaurus": "^1.12.0", | ||
"coveralls": "^3.0.9", | ||
"docusaurus": "^1.14.4", | ||
"eslint": "^5.16.0", | ||
"eslint-config-prettier": "^4.3.0", | ||
"eslint-plugin-import": "^2.18.2", | ||
"eslint-plugin-prettier": "^3.1.0", | ||
"jest": "^24.8.0", | ||
"prettier": "^1.18.2", | ||
"ts-jest": "^24.0.2", | ||
"typescript": "^3.5.3" | ||
"eslint-config-prettier": "^5.1.0", | ||
"eslint-plugin-import": "^2.20.0", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"jest": "^24.9.0", | ||
"prettier": "^1.19.1", | ||
"ts-jest": "^24.3.0", | ||
"typescript": "^3.7.5" | ||
}, | ||
@@ -65,0 +65,0 @@ "keywords": [ |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -18,39 +10,37 @@ const select_fields_1 = require("../select-fields"); | ||
} | ||
run(req, options = {}) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const context = this.builder.build(); | ||
const instances = this.selectFields(req, context.fields, context.locations); | ||
context.addFieldInstances(instances); | ||
const haltedInstances = new Set(); | ||
for (const contextItem of context.stack) { | ||
const promises = context.getData({ requiredOnly: true }).map((instance) => __awaiter(this, void 0, void 0, function* () { | ||
const instanceKey = `${instance.location}:${instance.path}`; | ||
if (haltedInstances.has(instanceKey)) { | ||
async run(req, options = {}) { | ||
const context = this.builder.build(); | ||
const instances = this.selectFields(req, context.fields, context.locations); | ||
context.addFieldInstances(instances); | ||
const haltedInstances = new Set(); | ||
for (const contextItem of context.stack) { | ||
const promises = context.getData({ requiredOnly: true }).map(async (instance) => { | ||
const instanceKey = `${instance.location}:${instance.path}`; | ||
if (haltedInstances.has(instanceKey)) { | ||
return; | ||
} | ||
try { | ||
await contextItem.run(context, instance.value, { | ||
req, | ||
location: instance.location, | ||
path: instance.path, | ||
}); | ||
} | ||
catch (e) { | ||
if (e instanceof base_1.ValidationHalt) { | ||
haltedInstances.add(instanceKey); | ||
return; | ||
} | ||
try { | ||
yield contextItem.run(context, instance.value, { | ||
req, | ||
location: instance.location, | ||
path: instance.path, | ||
}); | ||
} | ||
catch (e) { | ||
if (e instanceof base_1.ValidationHalt) { | ||
haltedInstances.add(instanceKey); | ||
return; | ||
} | ||
throw e; | ||
} | ||
})); | ||
yield Promise.all(promises); | ||
} | ||
if (options.saveContext === undefined || options.saveContext) { | ||
const internalReq = req; | ||
internalReq[base_1.contextsKey] = (internalReq[base_1.contextsKey] || []).concat(context); | ||
} | ||
return context; | ||
}); | ||
throw e; | ||
} | ||
}); | ||
await Promise.all(promises); | ||
} | ||
if (options.saveContext === undefined || options.saveContext) { | ||
const internalReq = req; | ||
internalReq[base_1.contextsKey] = (internalReq[base_1.contextsKey] || []).concat(context); | ||
} | ||
return context; | ||
} | ||
} | ||
exports.ContextRunnerImpl = ContextRunnerImpl; |
@@ -35,2 +35,3 @@ import { CustomValidator } from '../base'; | ||
isBefore(date?: string): Chain; | ||
isBIC(): Chain; | ||
isBoolean(): Chain; | ||
@@ -73,9 +74,11 @@ isByteLength(options: Options.MinMaxOptions): Chain; | ||
isMimeType(): Chain; | ||
isMobilePhone(locale: Options.MobilePhoneLocale, options?: Options.IsMobilePhoneOptions): Chain; | ||
isMobilePhone(locale: Options.MobilePhoneLocale | Options.MobilePhoneLocale[], options?: Options.IsMobilePhoneOptions): Chain; | ||
isMongoId(): Chain; | ||
isMultibyte(): Chain; | ||
isNumeric(options?: Options.IsNumericOptions): Chain; | ||
isOctal(): Chain; | ||
isPort(): Chain; | ||
isPostalCode(locale: Options.PostalCodeLocale): Chain; | ||
isRFC3339(): Chain; | ||
isSlug(): Chain; | ||
isSurrogatePair(): Chain; | ||
@@ -82,0 +85,0 @@ isURL(options?: Options.IsURLOptions): Chain; |
@@ -87,2 +87,5 @@ "use strict"; | ||
} | ||
isBIC() { | ||
return this.addStandardValidation(validator.isBIC); | ||
} | ||
isBoolean() { | ||
@@ -211,2 +214,5 @@ return this.addStandardValidation(validator.isBoolean); | ||
} | ||
isOctal() { | ||
return this.addStandardValidation(validator.isOctal); | ||
} | ||
isPort() { | ||
@@ -221,2 +227,5 @@ return this.addStandardValidation(validator.isPort); | ||
} | ||
isSlug() { | ||
return this.addStandardValidation(validator.isSlug); | ||
} | ||
isSurrogatePair() { | ||
@@ -223,0 +232,0 @@ return this.addStandardValidation(validator.isSurrogatePair); |
@@ -27,2 +27,3 @@ import { CustomValidator, DynamicMessageCreator } from '../base'; | ||
isBefore(date?: string): Return; | ||
isBIC(): Return; | ||
isBoolean(): Return; | ||
@@ -65,9 +66,11 @@ isByteLength(options: Options.MinMaxExtendedOptions): Return; | ||
isMimeType(): Return; | ||
isMobilePhone(locale: Options.MobilePhoneLocale, options?: Options.IsMobilePhoneOptions): Return; | ||
isMobilePhone(locale: Options.MobilePhoneLocale | Options.MobilePhoneLocale[], options?: Options.IsMobilePhoneOptions): Return; | ||
isMongoId(): Return; | ||
isMultibyte(): Return; | ||
isNumeric(options?: Options.IsNumericOptions): Return; | ||
isOctal(): Return; | ||
isPort(): Return; | ||
isPostalCode(locale: Options.PostalCodeLocale): Return; | ||
isRFC3339(): Return; | ||
isSlug(): Return; | ||
isSurrogatePair(): Return; | ||
@@ -74,0 +77,0 @@ isURL(options?: Options.IsURLOptions): Return; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -16,11 +8,9 @@ const base_1 = require("../base"); | ||
} | ||
run(_context, _value, meta) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const otherContext = yield this.chain.run(meta.req, { saveContext: false }); | ||
if (otherContext.errors.length) { | ||
throw new base_1.ValidationHalt(); | ||
} | ||
}); | ||
async run(_context, _value, meta) { | ||
const otherContext = await this.chain.run(meta.req, { saveContext: false }); | ||
if (otherContext.errors.length) { | ||
throw new base_1.ValidationHalt(); | ||
} | ||
} | ||
} | ||
exports.ChainCondition = ChainCondition; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -16,19 +8,17 @@ const base_1 = require("../base"); | ||
} | ||
run(_context, value, meta) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const result = this.condition(value, meta); | ||
yield result; | ||
// if the promise resolved or the result is truthy somehow, then there's no validation halt. | ||
if (!result) { | ||
// the error thrown here is symbolic, it will be re-thrown in the catch clause anyway. | ||
throw new Error(); | ||
} | ||
async run(_context, value, meta) { | ||
try { | ||
const result = this.condition(value, meta); | ||
await result; | ||
// if the promise resolved or the result is truthy somehow, then there's no validation halt. | ||
if (!result) { | ||
// the error thrown here is symbolic, it will be re-thrown in the catch clause anyway. | ||
throw new Error(); | ||
} | ||
catch (e) { | ||
throw new base_1.ValidationHalt(); | ||
} | ||
}); | ||
} | ||
catch (e) { | ||
throw new base_1.ValidationHalt(); | ||
} | ||
} | ||
} | ||
exports.CustomCondition = CustomCondition; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -16,24 +8,22 @@ class CustomValidation { | ||
} | ||
run(context, value, meta) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const result = this.validator(value, meta); | ||
const actualResult = yield result; | ||
const isPromise = result && result.then; | ||
const failed = this.negated ? actualResult : !actualResult; | ||
// A promise that was resolved only adds an error if negated. | ||
// Otherwise it always suceeds | ||
if ((!isPromise && failed) || (isPromise && this.negated)) { | ||
context.addError(this.message, value, meta); | ||
} | ||
async run(context, value, meta) { | ||
try { | ||
const result = this.validator(value, meta); | ||
const actualResult = await result; | ||
const isPromise = result && result.then; | ||
const failed = this.negated ? actualResult : !actualResult; | ||
// A promise that was resolved only adds an error if negated. | ||
// Otherwise it always suceeds | ||
if ((!isPromise && failed) || (isPromise && this.negated)) { | ||
context.addError(this.message, value, meta); | ||
} | ||
catch (err) { | ||
if (this.negated) { | ||
return; | ||
} | ||
context.addError((err instanceof Error ? err.message : err) || this.message, value, meta); | ||
} | ||
catch (err) { | ||
if (this.negated) { | ||
return; | ||
} | ||
}); | ||
context.addError((err instanceof Error ? err.message : err) || this.message, value, meta); | ||
} | ||
} | ||
} | ||
exports.CustomValidation = CustomValidation; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -19,18 +11,16 @@ const _ = require("lodash"); | ||
} | ||
run(context, value, meta) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const { req, path, location } = meta; | ||
const newValue = this.custom | ||
? this.sanitizer(value, meta) | ||
: this.sanitizer(utils_1.toString(value), ...this.options); | ||
context.setData(path, newValue, location); | ||
// Checks whether the value changed. | ||
// Avoids e.g. undefined values being set on the request if it didn't have the key initially. | ||
const reqValue = path !== '' ? _.get(req[location], path) : req[location]; | ||
if (reqValue !== newValue) { | ||
path !== '' ? _.set(req[location], path, newValue) : _.set(req, location, newValue); | ||
} | ||
}); | ||
async run(context, value, meta) { | ||
const { req, path, location } = meta; | ||
const newValue = this.custom | ||
? this.sanitizer(value, meta) | ||
: this.sanitizer(utils_1.toString(value), ...this.options); | ||
context.setData(path, newValue, location); | ||
// Checks whether the value changed. | ||
// Avoids e.g. undefined values being set on the request if it didn't have the key initially. | ||
const reqValue = path !== '' ? _.get(req[location], path) : req[location]; | ||
if (reqValue !== newValue) { | ||
path !== '' ? _.set(req[location], path, newValue) : _.set(req, location, newValue); | ||
} | ||
} | ||
} | ||
exports.Sanitization = Sanitization; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -18,11 +10,9 @@ const utils_1 = require("../utils"); | ||
} | ||
run(context, value, meta) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const result = this.validator(utils_1.toString(value), ...this.options); | ||
if (this.negated ? result : !result) { | ||
context.addError(this.message, value, meta); | ||
} | ||
}); | ||
async run(context, value, meta) { | ||
const result = this.validator(utils_1.toString(value), ...this.options); | ||
if (this.negated ? result : !result) { | ||
context.addError(this.message, value, meta); | ||
} | ||
} | ||
} | ||
exports.StandardValidation = StandardValidation; |
@@ -14,3 +14,3 @@ import { FieldInstance, Location, Meta, ValidationError } from './base'; | ||
private readonly _errors; | ||
readonly errors: ReadonlyArray<ValidationError>; | ||
get errors(): ReadonlyArray<ValidationError>; | ||
private readonly dataMap; | ||
@@ -17,0 +17,0 @@ constructor(fields: string[], locations: Location[], stack: ReadonlyArray<ContextItem>, optional: Optional, message?: any); |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -20,5 +12,5 @@ const chain_1 = require("../chain"); | ||
const runner = new chain_1.ContextRunnerImpl(builder); | ||
const middleware = (req, _res, next) => __awaiter(this, void 0, void 0, function* () { | ||
const middleware = async (req, _res, next) => { | ||
try { | ||
yield runner.run(req); | ||
await runner.run(req); | ||
next(); | ||
@@ -29,5 +21,5 @@ } | ||
} | ||
}); | ||
}; | ||
return Object.assign(middleware, utils_1.bindAll(runner), utils_1.bindAll(new chain_1.SanitizersImpl(builder, middleware)), utils_1.bindAll(new chain_1.ValidatorsImpl(builder, middleware)), utils_1.bindAll(new chain_1.ContextHandlerImpl(builder, middleware)), { builder }); | ||
} | ||
exports.check = check; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -15,8 +7,8 @@ const _ = require("lodash"); | ||
function oneOf(chains, message) { | ||
return (req, _res, next) => __awaiter(this, void 0, void 0, function* () { | ||
return async (req, _res, next) => { | ||
const surrogateContext = new context_builder_1.ContextBuilder().build(); | ||
// Run each group of chains in parallel, and within each group, run each chain in parallel too. | ||
const promises = chains.map((chain) => __awaiter(this, void 0, void 0, function* () { | ||
const promises = chains.map(async (chain) => { | ||
const group = Array.isArray(chain) ? chain : [chain]; | ||
const contexts = yield Promise.all(group.map(chain => chain.run(req, { saveContext: false }))); | ||
const contexts = await Promise.all(group.map(chain => chain.run(req, { saveContext: false }))); | ||
const groupErrors = _.flatMap(contexts, 'errors'); | ||
@@ -31,6 +23,6 @@ // #536: The data from a chain within oneOf() can only be made available to e.g. matchedData() | ||
return groupErrors; | ||
})); | ||
}); | ||
req[base_1.contextsKey] = (req[base_1.contextsKey] || []).concat(surrogateContext); | ||
try { | ||
const allErrors = yield Promise.all(promises); | ||
const allErrors = await Promise.all(promises); | ||
const success = allErrors.some(groupErrors => groupErrors.length === 0); | ||
@@ -46,4 +38,4 @@ if (!success) { | ||
} | ||
}); | ||
}; | ||
} | ||
exports.oneOf = oneOf; |
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -14,3 +6,10 @@ const chain_1 = require("../chain"); | ||
const context_builder_1 = require("../context-builder"); | ||
let hasNotified = false; | ||
function sanitize(fields = '', locations = []) { | ||
if (!hasNotified) { | ||
hasNotified = true; | ||
console.warn('express-validator: sanitize(), sanitizeBody() and other sanitization-only middlewares ' + | ||
'have been deprecated.\nPlease use check(), body() and others instead, which must offer ' + | ||
'the same API, and more.'); | ||
} | ||
const builder = new context_builder_1.ContextBuilder() | ||
@@ -20,5 +19,5 @@ .setFields(Array.isArray(fields) ? fields : [fields]) | ||
const runner = new chain_1.ContextRunnerImpl(builder); | ||
const middleware = (req, _res, next) => __awaiter(this, void 0, void 0, function* () { | ||
const middleware = async (req, _res, next) => { | ||
try { | ||
yield runner.run(req); | ||
await runner.run(req); | ||
next(); | ||
@@ -29,5 +28,5 @@ } | ||
} | ||
}); | ||
}; | ||
return Object.assign(middleware, utils_1.bindAll(runner), utils_1.bindAll(new chain_1.SanitizersImpl(builder, middleware)), { builder }); | ||
} | ||
exports.sanitize = sanitize; |
export declare type URLProtocol = 'http' | 'https' | 'ftp'; | ||
export declare type UUIDVersion = 3 | 4 | 5 | '3' | '4' | '5' | 'all'; | ||
export declare type IPVersion = 4 | 6; | ||
export declare type AlphaLocale = 'ar' | 'ar-AE' | 'ar-BH' | 'ar-DZ' | 'ar-EG' | 'ar-IQ' | 'ar-JO' | 'ar-KW' | 'ar-LB' | 'ar-LY' | 'ar-MA' | 'ar-QA' | 'ar-QM' | 'ar-SA' | 'ar-SD' | 'ar-SY' | 'ar-TN' | 'ar-YE' | 'bg-BG' | 'cs-CZ' | 'da-DK' | 'de-DE' | 'el-GR' | 'en-AU' | 'en-GB' | 'en-HK' | 'en-IN' | 'en-NZ' | 'en-US' | 'en-ZA' | 'en-ZM' | 'es-ES' | 'fr-FR' | 'hu-HU' | 'it-IT' | 'ku-IQ' | 'nb-NO' | 'nl-NL' | 'nn-NO' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sr-RS' | 'sr-RS@latin' | 'sv-SE' | 'tr-TR' | 'uk-UA'; | ||
export declare type AlphanumericLocale = 'ar' | 'ar-AE' | 'ar-BH' | 'ar-DZ' | 'ar-EG' | 'ar-IQ' | 'ar-JO' | 'ar-KW' | 'ar-LB' | 'ar-LY' | 'ar-MA' | 'ar-QA' | 'ar-QM' | 'ar-SA' | 'ar-SD' | 'ar-SY' | 'ar-TN' | 'ar-YE' | 'bg-BG' | 'cs-CZ' | 'da-DK' | 'de-DE' | 'el-GR' | 'en-AU' | 'en-GB' | 'en-HK' | 'en-IN' | 'en-NZ' | 'en-US' | 'en-ZA' | 'en-ZM' | 'es-ES' | 'fr-FR' | 'fr-BE' | 'hu-HU' | 'it-IT' | 'ku-IQ' | 'nb-NO' | 'nl-BE' | 'nl-NL' | 'nn-NO' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sr-RS' | 'sr-RS@latin' | 'sv-SE' | 'tr-TR' | 'uk-UA'; | ||
export declare type MobilePhoneLocale = 'any' | 'ar-AE' | 'ar-BH' | 'ar-DZ' | 'ar-EG' | 'ar-JO' | 'ar-IQ' | 'ar-KW' | 'ar-SA' | 'ar-SY' | 'ar-TN' | 'be-BY' | 'bg-BG' | 'bn-BD' | 'cs-CZ' | 'de-DE' | 'da-DK' | 'el-GR' | 'en-AU' | 'en-CA' | 'en-GB' | 'en-GH' | 'en-HK' | 'en-IE' | 'en-IN' | 'en-KE' | 'en-MT' | 'en-MU' | 'en-NG' | 'en-NZ' | 'en-PK' | 'en-RW' | 'en-SG' | 'en-TZ' | 'en-UG' | 'en-US' | 'en-ZA' | 'en-ZM' | 'es-CL' | 'es-ES' | 'es-MX' | 'es-PY' | 'es-UY' | 'et-EE' | 'fa-IR' | 'fi-FI' | 'fj-FJ' | 'fo-FO' | 'fr-FR' | 'he-IL' | 'hu-HU' | 'id-ID' | 'it-IT' | 'ja-JP' | 'kk-KZ' | 'kl-GL' | 'lt-LT' | 'ms-MY' | 'nb-NO' | 'nl-NL' | 'nn-NO' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ro-RO' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sr-RS' | 'sv-SE' | 'th-TH' | 'tr-TR' | 'uk-UA' | 'vi-VN' | 'zh-CN' | 'zh-HK' | 'zh-TW'; | ||
export declare type PostalCodeLocale = 'any' | 'AD' | 'AT' | 'AU' | 'BE' | 'BG' | 'BR' | 'CA' | 'CH' | 'CZ' | 'DE' | 'DK' | 'DZ' | 'EE' | 'ES' | 'FI' | 'FR' | 'GB' | 'GR' | 'HR' | 'HU' | 'ID' | 'IL' | 'IN' | 'IS' | 'IT' | 'JP' | 'KE' | 'LI' | 'LT' | 'LU' | 'LV' | 'MT' | 'MX' | 'NL' | 'NO' | 'NZ' | 'PL' | 'PR' | 'PT' | 'RO' | 'RU' | 'SA' | 'SE' | 'SI' | 'TN' | 'TW' | 'UA' | 'US' | 'ZA' | 'ZM'; | ||
export declare type AlphaLocale = 'ar' | 'ar-AE' | 'ar-BH' | 'ar-DZ' | 'ar-EG' | 'ar-IQ' | 'ar-JO' | 'ar-KW' | 'ar-LB' | 'ar-LY' | 'ar-MA' | 'ar-QA' | 'ar-QM' | 'ar-SA' | 'ar-SD' | 'ar-SY' | 'ar-TN' | 'ar-YE' | 'bg-BG' | 'cs-CZ' | 'da-DK' | 'de-DE' | 'el-GR' | 'en-AU' | 'en-GB' | 'en-HK' | 'en-IN' | 'en-NZ' | 'en-US' | 'en-ZA' | 'en-ZM' | 'es-ES' | 'fa-IR' | 'fr-FR' | 'he' | 'hu-HU' | 'it-IT' | 'ku-IQ' | 'nb-NO' | 'nl-NL' | 'nn-NO' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sr-RS' | 'sr-RS@latin' | 'sv-SE' | 'tr-TR' | 'uk-UA'; | ||
export declare type AlphanumericLocale = 'ar' | 'ar-AE' | 'ar-BH' | 'ar-DZ' | 'ar-EG' | 'ar-IQ' | 'ar-JO' | 'ar-KW' | 'ar-LB' | 'ar-LY' | 'ar-MA' | 'ar-QA' | 'ar-QM' | 'ar-SA' | 'ar-SD' | 'ar-SY' | 'ar-TN' | 'ar-YE' | 'bg-BG' | 'cs-CZ' | 'da-DK' | 'de-DE' | 'el-GR' | 'en-AU' | 'en-GB' | 'en-HK' | 'en-IN' | 'en-NZ' | 'en-US' | 'en-ZA' | 'en-ZM' | 'es-ES' | 'fa-IR' | 'fr-FR' | 'fr-BE' | 'he' | 'hu-HU' | 'it-IT' | 'ku-IQ' | 'nb-NO' | 'nl-BE' | 'nl-NL' | 'nn-NO' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sr-RS' | 'sr-RS@latin' | 'sv-SE' | 'tr-TR' | 'uk-UA'; | ||
export declare type MobilePhoneLocale = 'any' | 'ar-AE' | 'ar-BH' | 'ar-DZ' | 'ar-EG' | 'ar-JO' | 'ar-IQ' | 'ar-KW' | 'ar-SA' | 'ar-SY' | 'ar-TN' | 'be-BY' | 'bg-BG' | 'bn-BD' | 'cs-CZ' | 'de-AT' | 'de-DE' | 'da-DK' | 'el-GR' | 'en-AU' | 'en-CA' | 'en-GB' | 'en-GG' | 'en-GH' | 'en-HK' | 'en-IE' | 'en-IN' | 'en-KE' | 'en-MT' | 'en-MU' | 'en-NG' | 'en-NZ' | 'en-PK' | 'en-RW' | 'en-SG' | 'en-TZ' | 'en-UG' | 'en-US' | 'en-ZA' | 'en-ZM' | 'es-CL' | 'es-EC' | 'es-ES' | 'es-MX' | 'es-PA' | 'es-PY' | 'es-UY' | 'et-EE' | 'fa-IR' | 'fi-FI' | 'fj-FJ' | 'fo-FO' | 'fr-FR' | 'fr-GF' | 'fr-GP' | 'fr-MQ' | 'fr-RE' | 'he-IL' | 'hu-HU' | 'id-ID' | 'it-IT' | 'ja-JP' | 'kk-KZ' | 'kl-GL' | 'lt-LT' | 'ms-MY' | 'nb-NO' | 'nl-NL' | 'ne-NP' | 'nn-NO' | 'pl-PL' | 'pt-BR' | 'pt-PT' | 'ro-RO' | 'ru-RU' | 'sk-SK' | 'sl-SI' | 'sr-RS' | 'sv-SE' | 'th-TH' | 'tr-TR' | 'uk-UA' | 'vi-VN' | 'zh-CN' | 'zh-HK' | 'zh-TW'; | ||
export declare type PostalCodeLocale = 'any' | 'AD' | 'AT' | 'AU' | 'BE' | 'BG' | 'BR' | 'CA' | 'CH' | 'CZ' | 'DE' | 'DK' | 'DZ' | 'EE' | 'ES' | 'FI' | 'FR' | 'GB' | 'GR' | 'HR' | 'HU' | 'ID' | 'IL' | 'IN' | 'IS' | 'IR' | 'IT' | 'JP' | 'KE' | 'LI' | 'LT' | 'LU' | 'LV' | 'MT' | 'MX' | 'NL' | 'NO' | 'NZ' | 'PL' | 'PR' | 'PT' | 'RO' | 'RU' | 'SA' | 'SE' | 'SI' | 'TN' | 'TW' | 'UA' | 'US' | 'ZA' | 'ZM'; | ||
export declare type HashAlgorithm = 'md4' | 'md5' | 'sha1' | 'sha256' | 'sha384' | 'sha512' | 'ripemd128' | 'ripemd160' | 'tiger128' | 'tiger160' | 'tiger192' | 'crc32' | 'crc32b'; | ||
@@ -9,0 +9,0 @@ export declare type IdentityCard = 'any' | 'ES' | 'he-IL' | 'zh-TW'; |
@@ -7,3 +7,3 @@ "use strict"; | ||
const maybeFn = object[key]; | ||
if (typeof maybeFn === 'function') { | ||
if (typeof maybeFn === 'function' && key !== 'constructor') { | ||
object[key] = maybeFn.bind(object); | ||
@@ -10,0 +10,0 @@ } |
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
110775
1789
+ Addedvalidator@12.2.0(transitive)
- Removedvalidator@11.1.0(transitive)
Updatedvalidator@^12.1.0