Wondering what’s next for npm?Check out our public roadmap! »

@darkwolf/validator

21.13.4 • Public • Published

Validator

Install

npm i --save @darkwolf/validator

Using

⚠️ Requires Node.js v12.x LTS or higher to use!

import Validator from '@darkwolf/validator'
 
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

Install

npm i @darkwolf/validator

DownloadsWeekly Downloads

0

Version

21.13.4

License

MIT

Unpacked Size

12.2 kB

Total Files

7

Last publish

Collaborators

  • avatar