@darkwolf/validator
Advanced tools
Comparing version 2.1.9 to 2.2.0
32
index.js
@@ -157,2 +157,6 @@ class Validator { | ||
_isValidator(value) { | ||
return this._isInstance(value, Validator) | ||
} | ||
_isCodeError(value) { | ||
@@ -348,2 +352,14 @@ return this._isInstance(value, this.CodeError) | ||
_isBase64(value) { | ||
return this._isRegex(value, /^(([a-z\d+/]{4})*([a-z\d+/]{3}=|[a-z\d+/]{2}==)?){4,}$/i) | ||
} | ||
_isBase64Url(value) { | ||
return this._isRegex(value, /^[\w-]+$/) | ||
} | ||
_isBase58(value) { | ||
return this._isRegex(value, /^[AveDarkwo1f23456789BCEFGHJKLMNPQRSTUVWXYZbcdghijmnpqstuxyz]+$/) | ||
} | ||
_validate(method, args) { | ||
@@ -475,2 +491,6 @@ if (this._setted) { | ||
isValidator(...args) { | ||
return this._validate('_isValidator', args) | ||
} | ||
isCodeError(...args) { | ||
@@ -619,4 +639,16 @@ return this._validate('_isCodeError', args) | ||
} | ||
isBase64(...args) { | ||
return this._validate('_isBase64', args) | ||
} | ||
isBase64Url(...args) { | ||
return this._validate('_isBase64Url', args) | ||
} | ||
isBase58(...args) { | ||
return this._validate('_isBase58', args) | ||
} | ||
} | ||
module.exports = new Validator() |
{ | ||
"name": "@darkwolf/validator", | ||
"version": "2.1.9", | ||
"version": "2.2.0", | ||
"description": "Validator Utility", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -56,2 +56,3 @@ # Validator Utility | ||
### isTypeError(value?) | ||
### isValidator(value?) | ||
### isCodeError(value?) | ||
@@ -93,1 +94,4 @@ ### isNaN(value?) | ||
### isASCII(value?) | ||
### isBase64(value?) | ||
### isBase64Url(value?) | ||
### isBase58(value?) |
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
18330
508
96