@adonisjs/validator
Advanced tools
Comparing version 4.0.9 to 5.0.0
@@ -0,1 +1,21 @@ | ||
<a name="5.0.0"></a> | ||
# [5.0.0](https://github.com/adonisjs/adonis-validation-provider/compare/v4.0.9...v5.0.0) (2018-01-31) | ||
### Bug Fixes | ||
* **package:** update [@adonisjs](https://github.com/adonisjs)/generic-exceptions to version 2.0.0 ([#35](https://github.com/adonisjs/adonis-validation-provider/issues/35)) ([053f6ef](https://github.com/adonisjs/adonis-validation-provider/commit/053f6ef)) | ||
### Chores | ||
* **package:** update indicative to 5.0. ([99dfe94](https://github.com/adonisjs/adonis-validation-provider/commit/99dfe94)) | ||
### BREAKING CHANGES | ||
* **package:** one must use the formatters directly over defining the string reference | ||
<a name="4.0.9"></a> | ||
@@ -2,0 +22,0 @@ ## [4.0.9](https://github.com/adonisjs/adonis-validation-provider/compare/v4.0.8...v4.0.9) (2018-01-18) |
{ | ||
"name": "@adonisjs/validator", | ||
"version": "4.0.9", | ||
"version": "5.0.0", | ||
"description": "Validator for adonis framework", | ||
@@ -18,8 +18,8 @@ "main": "index.js", | ||
"dependencies": { | ||
"@adonisjs/generic-exceptions": "^1.0.0", | ||
"indicative": "^3.0.6", | ||
"@adonisjs/generic-exceptions": "^2.0.0", | ||
"indicative": "^5.0.2", | ||
"lodash": "^4.17.4" | ||
}, | ||
"devDependencies": { | ||
"@adonisjs/ace": "^4.0.7", | ||
"@adonisjs/ace": "^4.0.8", | ||
"@adonisjs/fold": "^4.0.5", | ||
@@ -30,5 +30,5 @@ "@adonisjs/sink": "^1.0.13", | ||
"cz-conventional-changelog": "^2.1.0", | ||
"japa": "^1.0.5", | ||
"japa": "^1.0.6", | ||
"japa-cli": "^1.0.1", | ||
"nyc": "^11.3.0", | ||
"nyc": "^11.4.1", | ||
"standard": "^10.0.3" | ||
@@ -35,0 +35,0 @@ }, |
@@ -32,3 +32,3 @@ 'use strict' | ||
* | ||
* @param {Array} options.messages | ||
* @param {Array} options.messages | ||
* @param {Object} options.request | ||
@@ -71,2 +71,2 @@ * @param {Object} options.response | ||
module.exports = { ValidationException } | ||
module.exports = { ValidationException, InvalidArgumentException: GE.InvalidArgumentException } |
@@ -62,3 +62,3 @@ 'use strict' | ||
*/ | ||
_.merge(data, sanitizedData) | ||
request.body = _.merge({}, data, sanitizedData) | ||
} | ||
@@ -65,0 +65,0 @@ |
@@ -78,2 +78,3 @@ 'use strict' | ||
} | ||
return this | ||
@@ -99,2 +100,3 @@ } | ||
} | ||
return this | ||
@@ -101,0 +103,0 @@ } |
@@ -13,4 +13,5 @@ 'use strict' | ||
const indicative = require('indicative') | ||
const Validation = require('../Validation') | ||
const { ValidationException } = require('../Exceptions') | ||
const { ValidationException, InvalidArgumentException } = require('../Exceptions') | ||
@@ -25,4 +26,9 @@ module.exports = { | ||
formatters: indicative.formatters, | ||
extend: indicative.extend, | ||
extend: function (rule, fn) { | ||
if (typeof (fn) !== 'function') { | ||
throw InvalidArgumentException.invalidParameter('Validator.extend expects 2nd parameter to be a function', fn) | ||
} | ||
indicative.validations[rule] = fn | ||
}, | ||
ValidationException | ||
} |
28181
633
+ Added@adonisjs/generic-exceptions@2.0.1(transitive)
+ Addedcross-env@5.2.1(transitive)
+ Addedcross-spawn@6.0.6(transitive)
+ Addedindicative@5.0.8(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addednice-try@1.0.5(transitive)
+ Addednode-exceptions@3.0.0(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedupcast@2.1.2(transitive)
+ Addedwhich@1.3.1(transitive)
- Removed@adonisjs/generic-exceptions@1.0.0(transitive)
- Removed@sindresorhus/is@0.7.0(transitive)
- Removed@slynova/slug@1.1.2(transitive)
- Removedcharmap@1.1.6(transitive)
- Removeddate-fns@1.30.1(transitive)
- Removedes6-object-assign@1.1.0(transitive)
- Removedhaye@1.0.1(transitive)
- Removedindicative@3.0.6(transitive)
- Removedlodash.kebabcase@4.1.1(transitive)
- Removednode-exceptions@2.0.2(transitive)
- Removedp-lazy@1.0.0(transitive)
- Removedp-limit@1.3.0(transitive)
- Removedp-reduce@1.0.0(transitive)
- Removedp-reflect@1.0.0(transitive)
- Removedp-series@1.1.0(transitive)
- Removedp-settle@2.1.0(transitive)
- Removedp-try@1.0.0(transitive)
- Removedpluralize@7.0.0(transitive)
- Removedpope@1.0.5(transitive)
- Removedupcast@1.0.4(transitive)
Updatedindicative@^5.0.2