Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@darkwolf/validator

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@darkwolf/validator - npm Package Compare versions

Comparing version 2.1.2 to 2.1.3

29

index.js

@@ -176,2 +176,10 @@ const CodeError = require('@darkwolf/code-error')

_isPositive(value) {
return this._isMore(value, 0)
}
_isNegative(value) {
return this._isLess(value, 0)
}
_isTrue(value) {

@@ -256,4 +264,8 @@ return this._isEqual(value, true)

_isIPv4(value) {
return this._isRegex(value, /^((\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])$/)
}
_isUrl(value) {
return this._isRegex(value, /^(https?:\/\/)?((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|((\d{1,3}\.){3}\d{1,3}))(\:\d+)?(\/[\w-.%+@&:~]*)*(\?[\w-.%+@&=:;,~]*)?(\#[\w-]*)?$/i)
return this._isRegex(value, /^(https?:\/\/)?((([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}|((\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5]))(:\d+)?(\/[\w-.%+@&:~]*)*(\?[\w-.%+@&=:;,~]*)?(#[\w-]*)?$/i)
}

@@ -463,2 +475,12 @@

isPositive(...args) {
if (args.length) return this._isPositive(...args)
return this._valid(() => this._isPositive(this.value))
}
isNegative(...args) {
if (args.length) return this._isNegative(...args)
return this._valid(() => this._isNegative(this.value))
}
isTrue(...args) {

@@ -525,2 +547,7 @@ if (args.length) return this._isTrue(...args)

isIPv4(...args) {
if (args.length) return this._isIPv4(...args)
return this._valid(() => this._isIPv4(this.value))
}
isUrl(...args) {

@@ -527,0 +554,0 @@ if (args.length) return this._isUrl(...args)

2

package.json
{
"name": "@darkwolf/validator",
"version": "2.1.2",
"version": "2.1.3",
"description": "Validator Utility",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -68,2 +68,4 @@ # Validator Utility

### isRange(value?, min, max)
### isPositive(value?)
### isNegative(value?)
### isRegex(value?, regex)

@@ -79,4 +81,5 @@ ### isRequired(value?)

### isUUID(value?)
### isIPv4(value?)
### isUrl(value?)
### isEmail(value?)
### isPhoneNumber(value?)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc