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

Validator

  • 21.13.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-91.07%
Maintainers
1
Weekly downloads
 
Created
Source

Validator

Install

npm i --save @darkwolf/validator

Using

import validator from '@darkwolf/validator'
import isUnixTimestamp from '@darkwolf/validator/isUnixTimestamp'

// Import and use only what you need
validator
  .define('isUnixTimestamp', isUnixTimestamp)
  // You can also define your custom validator
  .define('isIntegerUnixTimestamp', value =>
    validator.isInteger(value) &&
    validator.isUnixTimestamp(value)
  )
const obj = {
  ave: {
    darkwolf: {
      arr: [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024]
    },
    user: {
      username: null,
      email: undefined
    }
  }
}
validator.has(obj, 'ave.darkwolf') // true
validator.has(obj, 'ave.user.username') // true
validator.has(obj, 'ave.user.email') // true
validator.exists(false) // true
validator.exists(obj, 'ave.user.username') // false
validator.exists(obj, 'ave.user.email') // false
validator.exists(obj, ['ave', 'darkwolf', 'arr', '[0]']) // true
validator.exists(obj, ['ave.darkwolf.arr[10]']) // false

API Documentation

Donate

You can contribute to the development of open source projects by making your donation
Bitcoin (BTC): 15sjjAUtJdB1ncsxKK7KtyJPtF46UhXWo4
Ethereum (ETH): 0xF02F68eb33E9eC73b8E9c3c0953E6782E2376867
Bitcoin Cash (BCH): qq6h3a78h3wlt04eyp9ydht94r6guzjdps9hqwgfzw

Contact Me

GitHub: @PavelWolfDark
Telegram: @PavelWolfDark
Email: PavelWolfDark@gmail.com

Keywords

FAQs

Package last updated on 19 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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