@adonisjs/validator
Advanced tools
Comparing version 10.0.0 to 11.0.0
@@ -470,4 +470,4 @@ /// <reference types="validator" /> | ||
requireHost?: boolean; | ||
hostWhitelist?: string[]; | ||
hostBlacklist?: string[]; | ||
allowedHosts?: string[]; | ||
bannedHosts?: string[]; | ||
validateLength?: boolean; | ||
@@ -637,5 +637,5 @@ ensureProtocol?: string | boolean; | ||
/** | ||
* Blacklist an array of values | ||
* Ensure value is not in the defined array | ||
*/ | ||
blacklist(keywords: (number | string)[] | SchemaRef<(number | string)[]>): Rule; | ||
notIn(keywords: (number | string)[] | SchemaRef<(number | string)[]>): Rule; | ||
/** | ||
@@ -642,0 +642,0 @@ * The value of string must be equalToValue |
@@ -136,3 +136,3 @@ "use strict"; | ||
if (!OPERATORS[operator]) { | ||
throw new Error(`"${RULE_NAME}": expects "operator" to be one of the whitelisted operators`); | ||
throw new Error(`"${RULE_NAME}": expects "operator" to be one of the allowed values`); | ||
} | ||
@@ -139,0 +139,0 @@ /** |
@@ -17,3 +17,3 @@ export { distinct } from './array/distinct'; | ||
export { requiredWhen } from './existence/requiredWhen'; | ||
export { blacklist } from './miscellaneous/blacklist'; | ||
export { notIn } from './miscellaneous/notIn'; | ||
export { unsigned } from './number/unsigned'; | ||
@@ -20,0 +20,0 @@ export { range } from './number/range'; |
@@ -11,3 +11,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.equalTo = exports.minLength = exports.maxLength = exports.mobile = exports.uuid = exports.ip = exports.url = exports.email = exports.regex = exports.alpha = exports.string = exports.object = exports.number = exports.file = exports.enumSet = exports.enum = exports.date = exports.boolean = exports.array = exports.range = exports.unsigned = exports.blacklist = exports.requiredWhen = exports.requiredIfNotExistsAny = exports.requiredIfNotExistsAll = exports.requiredIfNotExists = exports.requiredIfExistsAny = exports.requiredIfExistsAll = exports.requiredIfExists = exports.required = exports.confirmed = exports.beforeOrEqualToField = exports.beforeField = exports.before = exports.afterOrEqualToField = exports.afterField = exports.after = exports.distinct = void 0; | ||
exports.equalTo = exports.minLength = exports.maxLength = exports.mobile = exports.uuid = exports.ip = exports.url = exports.email = exports.regex = exports.alpha = exports.string = exports.object = exports.number = exports.file = exports.enumSet = exports.enum = exports.date = exports.boolean = exports.array = exports.range = exports.unsigned = exports.notIn = exports.requiredWhen = exports.requiredIfNotExistsAny = exports.requiredIfNotExistsAll = exports.requiredIfNotExists = exports.requiredIfExistsAny = exports.requiredIfExistsAll = exports.requiredIfExists = exports.required = exports.confirmed = exports.beforeOrEqualToField = exports.beforeField = exports.before = exports.afterOrEqualToField = exports.afterField = exports.after = exports.distinct = void 0; | ||
var distinct_1 = require("./array/distinct"); | ||
@@ -45,4 +45,4 @@ Object.defineProperty(exports, "distinct", { enumerable: true, get: function () { return distinct_1.distinct; } }); | ||
Object.defineProperty(exports, "requiredWhen", { enumerable: true, get: function () { return requiredWhen_1.requiredWhen; } }); | ||
var blacklist_1 = require("./miscellaneous/blacklist"); | ||
Object.defineProperty(exports, "blacklist", { enumerable: true, get: function () { return blacklist_1.blacklist; } }); | ||
var notIn_1 = require("./miscellaneous/notIn"); | ||
Object.defineProperty(exports, "notIn", { enumerable: true, get: function () { return notIn_1.notIn; } }); | ||
var unsigned_1 = require("./number/unsigned"); | ||
@@ -49,0 +49,0 @@ Object.defineProperty(exports, "unsigned", { enumerable: true, get: function () { return unsigned_1.unsigned; } }); |
@@ -36,8 +36,10 @@ "use strict"; | ||
require_tld: options.requireTld === false ? false : true, | ||
require_protocol: options.requireProtocol === true ? true : false, | ||
require_protocol: options.requireProtocol === undefined | ||
? options.protocols !== undefined // Set to true when protocols are defined | ||
: options.requireProtocol, | ||
require_host: options.requireHost === false ? false : true, | ||
require_valid_protocol: !!(options.protocols && options.protocols.length), | ||
validate_length: options.validateLength === false ? false : true, | ||
...(options.hostWhitelist ? { host_whitelist: options.hostWhitelist } : {}), | ||
...(options.hostBlacklist ? { host_blacklist: options.hostBlacklist } : {}), | ||
...(options.allowedHosts ? { host_whitelist: options.allowedHosts } : {}), | ||
...(options.bannedHosts ? { host_blacklist: options.bannedHosts } : {}), | ||
}, | ||
@@ -44,0 +46,0 @@ sanitizationOptions: { |
{ | ||
"name": "@adonisjs/validator", | ||
"version": "10.0.0", | ||
"version": "11.0.0", | ||
"description": "Validator for adonis framework", | ||
@@ -72,10 +72,10 @@ "main": "build/providers/ValidatorProvider.js", | ||
"devDependencies": { | ||
"@adonisjs/application": "^5.0.0", | ||
"@adonisjs/bodyparser": "^7.0.0", | ||
"@adonisjs/application": "^5.1.0", | ||
"@adonisjs/bodyparser": "^7.0.1", | ||
"@adonisjs/encryption": "^4.0.1", | ||
"@adonisjs/http-server": "^5.2.0", | ||
"@adonisjs/http-server": "^5.3.0", | ||
"@adonisjs/mrm-preset": "^3.0.0", | ||
"@adonisjs/require-ts": "^2.0.3", | ||
"@poppinss/dev-utils": "^1.1.1", | ||
"@types/node": "^14.14.35", | ||
"@types/node": "^14.14.41", | ||
"benchmark": "^2.1.4", | ||
@@ -86,9 +86,9 @@ "class-validator": "^0.13.1", | ||
"del-cli": "^3.0.1", | ||
"eslint": "^7.22.0", | ||
"eslint-config-prettier": "^8.1.0", | ||
"eslint": "^7.24.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-adonis": "^1.3.0", | ||
"eslint-plugin-prettier": "^3.3.1", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"execa": "^5.0.0", | ||
"github-label-sync": "^2.0.0", | ||
"husky": "^5.2.0", | ||
"husky": "^6.0.0", | ||
"indicative": "^7.4.4", | ||
@@ -98,15 +98,15 @@ "japa": "^3.1.1", | ||
"kleur": "^4.1.4", | ||
"mrm": "^2.6.1", | ||
"mrm": "^3.0.1", | ||
"np": "^7.4.0", | ||
"prettier": "^2.2.1", | ||
"typescript": "^4.2.3" | ||
"typescript": "^4.2.4" | ||
}, | ||
"dependencies": { | ||
"@poppinss/utils": "^3.0.5", | ||
"@types/luxon": "^1.26.2", | ||
"@poppinss/utils": "^3.1.0", | ||
"@types/luxon": "^1.26.4", | ||
"@types/validator": "^13.1.3", | ||
"luxon": "^1.26.0", | ||
"normalize-url": "^5.3.0", | ||
"normalize-url": "^6.0.0", | ||
"tmp-cache": "^1.1.0", | ||
"validator": "^13.5.2" | ||
"validator": "^13.6.0" | ||
}, | ||
@@ -113,0 +113,0 @@ "peerDependencies": { |
206204
5845
+ Addednormalize-url@6.1.0(transitive)
- Removednormalize-url@5.3.1(transitive)
Updated@poppinss/utils@^3.1.0
Updated@types/luxon@^1.26.4
Updatednormalize-url@^6.0.0
Updatedvalidator@^13.6.0