@darkwolf/validator
Advanced tools
Comparing version 2.0.4 to 2.0.5
27
index.js
@@ -101,2 +101,14 @@ class Validator { | ||
_isInteger(value) { | ||
return Number.isInteger(value) | ||
} | ||
_isSafeInteger(value) { | ||
return Number.isSafeInteger(value) | ||
} | ||
_isFloat(value) { | ||
return this._isNumber(value) && this._isFinite(value) && value % 1 | ||
} | ||
_isInfinity(value) { | ||
@@ -236,2 +248,17 @@ return Math.abs(value) === Infinity | ||
isInteger(...args) { | ||
if (args.length) return this._isInteger(...args) | ||
return this._valid(() => this._isInteger(this.value)) | ||
} | ||
isSafeInteger(...args) { | ||
if (args.length) return this._isSafeInteger(...args) | ||
return this._valid(() => this._isSafeInteger(this.value)) | ||
} | ||
isFloat(...args) { | ||
if (args.length) return this._isFloat(...args) | ||
return this._valid(() => this._isFloat(this.value)) | ||
} | ||
isInfinity(...args) { | ||
@@ -238,0 +265,0 @@ if (args.length) return this._isInfinity(...args) |
{ | ||
"name": "@darkwolf/validator", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Validator Utility", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -48,2 +48,5 @@ # Validator Utility | ||
### isFinite(value?) | ||
### isInteger(value?) | ||
### isSafeInteger(value?) | ||
### isFloat(value?) | ||
### isInfinity(value?) | ||
@@ -50,0 +53,0 @@ ### isMore(value?, number) |
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
10186
237
59