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 6.7.1 to 6.7.2

2

package.json
{
"name": "@darkwolf/validator",
"version": "6.7.1",
"version": "6.7.2",
"description": "Validator",

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

@@ -41,2 +41,3 @@ # Validator

### isFunction(value?)
### isCallback(value?)
### isBoolean(value?)

@@ -43,0 +44,0 @@ ### isNumber(value?)

const TIMESTAMP_REGEX = /^[1-9]\d{11,12}$/
const UNIX_TIMESTAMP_REGEX = /^[1-9]\d{8,9}$/
const UUID_REGEX = /^[a-f\d]{8}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{4}-[a-f\d]{12}$/i
const IPV4_REGEX = /^((\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])$/
const IPv4_REGEX = /^((\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])$/
const URL_REGEX = /^(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

@@ -18,3 +18,3 @@ const EMAIL_REGEX = /^[\w-.]+@(([a-z\d]([a-z\d-]*[a-z\d])*)\.)+[a-z]{2,}$/i

UUID_REGEX,
IPV4_REGEX,
IPv4_REGEX,
URL_REGEX,

@@ -21,0 +21,0 @@ EMAIL_REGEX,

@@ -361,3 +361,3 @@ const CodeError = require('@darkwolf/code-error')

_isIPv4(value) {
return this._isRegex(value, constants.IPV4_REGEX)
return this._isRegex(value, constants.IPv4_REGEX)
}

@@ -496,2 +496,6 @@

isCallback(...args) {
return this.validate((...args) => this._isFunction(...args), () => `${this.name} must be a callback function`, ...args)
}
isBoolean(...args) {

@@ -498,0 +502,0 @@ return this.validate((...args) => this._isBoolean(...args), () => `${this.name} must be boolean`, ...args)

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