@adonisjs/validator
Advanced tools
Comparing version 7.0.3 to 7.1.0
/// <reference types="validator" /> | ||
declare module '@ioc:Adonis/Core/Validator' { | ||
import { DateTime } from 'luxon'; | ||
import { UUIDVersion } from 'validator/lib/isUUID'; | ||
import { default as validatorJs } from 'validator'; | ||
@@ -417,2 +418,6 @@ import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'; | ||
alpha(): Rule; | ||
/** | ||
* String must match regex | ||
*/ | ||
regex(regexPattern: RegExp): Rule; | ||
email(options?: EmailRuleOptions): Rule; | ||
@@ -422,2 +427,5 @@ ip(options?: { | ||
}): Rule; | ||
uuid(options?: { | ||
version?: UUIDVersion; | ||
}): Rule; | ||
mobile(optioms?: { | ||
@@ -424,0 +432,0 @@ strict?: boolean; |
@@ -29,14 +29,19 @@ "use strict"; | ||
*/ | ||
switch (this.accepts(['html', 'application/vnd.api+json', 'json'])) { | ||
case 'html': | ||
case null: | ||
Reporter = ErrorReporters.VanillaErrorReporter; | ||
break; | ||
case 'json': | ||
Reporter = ErrorReporters.ApiErrorReporter; | ||
break; | ||
case 'application/vnd.api+json': | ||
Reporter = ErrorReporters.JsonApiErrorReporter; | ||
break; | ||
if (this.ajax()) { | ||
Reporter = ErrorReporters.ApiErrorReporter; | ||
} | ||
else { | ||
switch (this.accepts(['html', 'application/vnd.api+json', 'json'])) { | ||
case 'html': | ||
case null: | ||
Reporter = ErrorReporters.VanillaErrorReporter; | ||
break; | ||
case 'json': | ||
Reporter = ErrorReporters.ApiErrorReporter; | ||
break; | ||
case 'application/vnd.api+json': | ||
Reporter = ErrorReporters.JsonApiErrorReporter; | ||
break; | ||
} | ||
} | ||
/** | ||
@@ -43,0 +48,0 @@ * Merging request body, files and the params. The params are nested, since |
@@ -27,5 +27,5 @@ "use strict"; | ||
/** | ||
* Flash all input, except the `_csrf_token`. | ||
* Flash all input, except the `_csrf`. | ||
*/ | ||
session.flashExcept(['_csrf_token']); | ||
session.flashExcept(['_csrf']); | ||
/** | ||
@@ -32,0 +32,0 @@ * Flash errors |
@@ -21,6 +21,8 @@ export { confirmed } from './existence/confirmed'; | ||
export { alpha } from './string/alpha'; | ||
export { regex } from './string/regex'; | ||
export { email } from './string/email'; | ||
export { ip } from './string/ip'; | ||
export { uuid } from './string/uuid'; | ||
export { mobile } from './string/mobile'; | ||
export { maxLength } from './string-and-array/maxLength'; | ||
export { minLength } from './string-and-array/minLength'; |
@@ -51,2 +51,4 @@ "use strict"; | ||
exports.alpha = alpha_1.alpha; | ||
var regex_1 = require("./string/regex"); | ||
exports.regex = regex_1.regex; | ||
var email_1 = require("./string/email"); | ||
@@ -56,2 +58,4 @@ exports.email = email_1.email; | ||
exports.ip = ip_1.ip; | ||
var uuid_1 = require("./string/uuid"); | ||
exports.uuid = uuid_1.uuid; | ||
var mobile_1 = require("./string/mobile"); | ||
@@ -58,0 +62,0 @@ exports.mobile = mobile_1.mobile; |
{ | ||
"name": "@adonisjs/validator", | ||
"version": "7.0.3", | ||
"version": "7.1.0", | ||
"description": "Validator for adonis framework", | ||
@@ -78,5 +78,5 @@ "main": "build/providers/ValidatorProvider.js", | ||
"@hapi/joi": "^17.1.1", | ||
"@types/node": "^13.13.0", | ||
"@types/node": "^13.13.4", | ||
"benchmark": "^2.1.4", | ||
"class-validator": "^0.12.1", | ||
"class-validator": "^0.12.2", | ||
"commitizen": "^4.0.4", | ||
@@ -94,7 +94,7 @@ "cz-conventional-changelog": "^3.1.0", | ||
"np": "^5.2.1", | ||
"ts-node": "^8.8.2", | ||
"ts-node": "^8.9.1", | ||
"typescript": "^3.8.3" | ||
}, | ||
"dependencies": { | ||
"@poppinss/utils": "^2.2.4", | ||
"@poppinss/utils": "^2.2.6", | ||
"@types/luxon": "^1.22.0", | ||
@@ -101,0 +101,0 @@ "@types/validator": "^13.0.0", |
145601
99
4283
Updated@poppinss/utils@^2.2.6