@darkwolf/validator
Advanced tools
Comparing version 2.1.1 to 2.1.2
29
index.js
@@ -0,1 +1,3 @@ | ||
const CodeError = require('@darkwolf/code-error') | ||
class Validator { | ||
@@ -106,2 +108,14 @@ constructor(value) { | ||
_isError(value) { | ||
return this._isInstance(value, Error) | ||
} | ||
_isTypeError(value) { | ||
return this._isInstance(value, TypeError) | ||
} | ||
_isCodeError(value) { | ||
return this._isInstance(value, CodeError) | ||
} | ||
_isObjectExact(value) { | ||
@@ -363,2 +377,17 @@ return Object.prototype.toString.call(value) === '[object Object]' | ||
isError(...args) { | ||
if (args.length) return this._isError(...args) | ||
return this._valid(() => this._isError(this.value)) | ||
} | ||
isTypeError(...args) { | ||
if (args.length) return this._isTypeError(...args) | ||
return this._valid(() => this._isTypeError(this.value)) | ||
} | ||
isCodeError(...args) { | ||
if (args.length) return this._isCodeError(...args) | ||
return this._valid(() => this._isCodeError(this.value)) | ||
} | ||
isObjectExact(...args) { | ||
@@ -365,0 +394,0 @@ if (args.length) return this._isObjectExact(...args) |
{ | ||
"name": "@darkwolf/validator", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Validator Utility", | ||
@@ -23,3 +23,6 @@ "main": "index.js", | ||
}, | ||
"homepage": "https://github.com/darkwolf/validator#readme" | ||
"homepage": "https://github.com/darkwolf/validator#readme", | ||
"dependencies": { | ||
"@darkwolf/code-error": "^2.0.9" | ||
} | ||
} |
@@ -49,2 +49,5 @@ # Validator Utility | ||
### isUnixTimestamp(value?) | ||
### isError(value?) | ||
### isTypeError(value?) | ||
### isCodeError(value?) | ||
### isObjectExact(value?) | ||
@@ -51,0 +54,0 @@ ### isTrue(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
17290
428
81
1
+ Added@darkwolf/code-error@^2.0.9
+ Added@darkwolf/code-error@2.1.0(transitive)
+ Added@darkwolf/validator@2.2.1(transitive)