Skip to content

Commit

Permalink
Release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Gama committed May 29, 2017
1 parent d488f65 commit 47db529
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## [v1.1.0](https://github.com/uphold/validator.js-validate/releases/tag/v1.1.0) (2017-05-29)
- Add deepRequired option [\#4](https://github.com/uphold/validator.js-validate/pull/4) ([ricardogama](https://github.com/ricardogama))

## [v1.0.1](https://github.com/uphold/validator.js-validate/releases/tag/v1.0.1) (2017-05-23)
- Fix masking collection elements [\#3](https://github.com/uphold/validator.js-validate/pull/3) ([ricardogama](https://github.com/ricardogama))

Expand Down
8 changes: 5 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,17 @@ exports.default = ValidationFailedError => {
const validator = new _validator.Validator();

return function (data, constraints) {
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
_ref$deepRequired = _ref.deepRequired;

let groups = _ref.groups;
let deepRequired = _ref$deepRequired === undefined ? true : _ref$deepRequired,
groups = _ref.groups;
var _ref$mask = _ref.mask;
let mask = _ref$mask === undefined ? true : _ref$mask;
var _ref$throws = _ref.throws;
let throws = _ref$throws === undefined ? true : _ref$throws;

const constraint = constraints instanceof _validator.Assert ? constraints : new _validator.Constraint(constraints, { deepRequired: true });
const constraint = constraints instanceof _validator.Assert ? constraints : new _validator.Constraint(constraints, { deepRequired: deepRequired });
const errors = validator.validate(data, constraint, groups);

if (errors === true) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "validator.js-validate",
"version": "1.0.1",
"version": "1.1.0",
"description": "Opinionated object validation function based on validator.js",
"homepage": "http://uphold.github.io/validator.js-validate",
"bugs": "https://github.com/uphold/validator.js-validate/issues",
Expand Down

0 comments on commit 47db529

Please sign in to comment.