Skip to content

Commit

Permalink
Fixes cloning issue. Updates to v2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kamronbatman committed Aug 10, 2017
1 parent 175dc64 commit 5de4151
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@ const PasswordComplexity = class extends Any {
}
}

clone() {
const clone = super.clone();

clone._options = {};

clone._options.min = this._options.min;
clone._options.max = this._options.max;
clone._options.lowerCase = this._options.lowerCase;
clone._options.upperCase = this._options.upperCase;
clone._options.numeric = this._options.numeric;
clone._options.symbol = this._options.symbol;
clone._options.requirementCount = this._options.requirementCount;

return clone;
}

_base(value, state, options) {
let validated = 0;
let matchMin = false;
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": "joi-password-complexity",
"version": "2.0.0",
"version": "2.0.1",
"description": "Joi validation for password complexity requirements.",
"main": "lib/index.js",
"scripts": {
Expand Down

0 comments on commit 5de4151

Please sign in to comment.