@darkwolf/validator
Advanced tools
Comparing version 1.1.1 to 1.1.2
10
index.js
@@ -17,2 +17,3 @@ const CodeError = require('@darkwolf/code-error') | ||
this.isPassword = this.isPassword.bind(this) | ||
this.isVerificationCode = this.isVerificationCode.bind(this) | ||
} | ||
@@ -92,2 +93,6 @@ | ||
isVerificationCode(value) { | ||
return /^\d{6}$/.test(value) | ||
} | ||
isValidBoolean(value, name, code, data) { | ||
@@ -171,4 +176,9 @@ if (!this.isBoolean(value)) { | ||
} | ||
isValidVerificationCode(value) { | ||
if (!this.isVerificationCode(value)) throw errors.INVALID_VERIFICATION_CODE | ||
return true | ||
} | ||
} | ||
module.exports = new Validator() |
{ | ||
"name": "@darkwolf/validator", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Validator", | ||
@@ -25,4 +25,4 @@ "main": "index.js", | ||
"@darkwolf/code-error": "^1.0.2", | ||
"@darkwolf/errors": "^1.1.2" | ||
"@darkwolf/errors": "^1.1.5" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5206
148
Updated@darkwolf/errors@^1.1.5