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 13.21.76 to 13.21.77

34

index.js

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

const isNonPositive = value => isLessEqual(value, 0)
const isNatural = value => isInteger(value) && isPositive(value)
const isPositiveInteger = value => isInteger(value) && isPositive(value)
const isPositiveFloat = value => isFloat(value) && isPositive(value)
const isNegativeInteger = value => isInteger(value) && isNegative(value)
const isNegativeFloat = value => isFloat(value) && isNegative(value)
const isNonNegativeInteger = value => isInteger(value) && isNonNegative(value)
const isNonNegativeFloat = value => isFloat(value) && isNonNegative(value)
const isNonPositiveInteger = value => isInteger(value) && isNonPositive(value)
const isNonPositiveFloat = value => isInteger(value) && isNonPositive(value)
const isNatural = value => isNonNegativeInteger(value)
const isEven = value => isInteger(value) && !(value % 2)

@@ -75,2 +83,10 @@ const isOdd = value => isInteger(value) && !!(value % 2)

if (args.length > 1) return isRange(length, ...args)
const [options] = args
if (isPlainObject(options)) {
const {min, max} = options
if (options.hasOwnProperty('min') && options.hasOwnProperty('max')) return isRange(length, min, max)
if (options.hasOwnProperty('min')) return isMoreEqual(length, min)
if (options.hasOwnProperty('max')) return isLessEqual(length, max)
return false
}
return isStrictEqual(length, ...args)

@@ -88,2 +104,10 @@ }

if (args.length > 1) return isRange(size, ...args)
const [options] = args
if (isPlainObject(options)) {
const {min, max} = options
if (options.hasOwnProperty('min') && options.hasOwnProperty('max')) return isRange(size, min, max)
if (options.hasOwnProperty('min')) return isMoreEqual(size, min)
if (options.hasOwnProperty('max')) return isLessEqual(size, max)
return false
}
return isStrictEqual(size, ...args)

@@ -203,2 +227,10 @@ }

isNonPositive,
isPositiveInteger,
isPositiveFloat,
isNegativeInteger,
isNegativeFloat,
isNonNegativeInteger,
isNonNegativeFloat,
isNonPositiveInteger,
isNonPositiveFloat,
isNatural,

@@ -205,0 +237,0 @@ isEven,

2

package.json
{
"name": "@darkwolf/validator",
"version": "13.21.76",
"version": "13.21.77",
"description": "Validator",

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

@@ -58,2 +58,10 @@ # Validator

### isNonPositive(value)
### isPositiveInteger(value)
### isPositiveFloat(value)
### isNegativeInteger(value)
### isNegativeFloat(value)
### isNonNegativeInteger(value)
### isNonNegativeFloat(value)
### isNonPositiveInteger(value)
### isNonPositiveFloat(value)
### isNatural(value)

@@ -71,4 +79,4 @@ ### isEven(value)

### isKey(value)
### isLength(value, number || ...[min, max])
### isSize(value, number || ...[min, max])
### isLength(value, number || ...[min, max] || options[min, max])
### isSize(value, number || ...[min, max] || options[min, max])
### isEmpty(value)

@@ -75,0 +83,0 @@ ### isHas(value, key)

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