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.71 to 13.21.72

11

constants.js

@@ -0,1 +1,3 @@

const BASE58_ALPHABET = 'AveDarkwo1f23456789BCEFGHJKLMNPQRSTUVWXYZbcdghijmnpqstuxyz'
const TIMESTAMP_REGEX = /^[1-9]\d{11,12}$/

@@ -11,6 +13,9 @@ const UNIX_TIMESTAMP_REGEX = /^[1-9]\d{8,9}$/

const BASE64URL_REGEX = /^[\w-]+$/
const BASE58_REGEX = /^[AveDarkwo1f23456789BCEFGHJKLMNPQRSTUVWXYZbcdghijmnpqstuxyz]+$/
const BASE58_REGEX = new RegExp(`^[${BASE58_ALPHABET}]+$`)
const JWT_REGEX = /^[\w-]+\.[\w-]+\.[\w-]*$/
const HASH_REGEX = new RegExp(`^[${BASE58_ALPHABET}]{64}$`)
const UID_REGEX = new RegExp(`^[${BASE58_ALPHABET}]{20}$`)
module.exports = {
BASE58_ALPHABET,
TIMESTAMP_REGEX,

@@ -27,3 +32,5 @@ UNIX_TIMESTAMP_REGEX,

BASE58_REGEX,
JWT_REGEX
JWT_REGEX,
HASH_REGEX,
UID_REGEX
}

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

const isNonPositive = value => isLessEqual(value, 0)
const isNatural = value => isInteger(value) && isPositive(value)
const isEven = value => isInteger(value) && !(value % 2)

@@ -138,2 +139,4 @@ const isOdd = value => isInteger(value) && !!(value % 2)

const isJWT = value => constants.JWT_REGEX.test(value)
const isHash = value => constants.HASH_REGEX.test(value)
const isUid = value => constants.UID_REGEX.test(value)

@@ -185,2 +188,3 @@ module.exports = {

isNonPositive,
isNatural,
isEven,

@@ -214,3 +218,5 @@ isOdd,

isBase58,
isJWT
isJWT,
isHash,
isUid
}

2

package.json
{
"name": "@darkwolf/validator",
"version": "13.21.71",
"version": "13.21.72",
"description": "Validator",

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

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

### isNonPositive(value)
### isNatural(value)
### isEven(value)

@@ -88,1 +89,3 @@ ### isOdd(value)

### isJWT(value)
### isHash(value)
### isUid(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