Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

validazz

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

validazz

Magical, Flexible and Extendible Javascript Validation

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

validazz

Generated with nod NPM version Build Status Coverage Status

Magical, Flexible and Extendible Javascript Validation

Install

npm:

npm i validazz

Yarn:

yarn add validazz

Usage

import Validator, { rules } from 'validazz'

const mySuperCoolValidator = Validator.factory()

// Let's add some rules
mySuperCoolValidator.addRule(rules.isRequired)
mySuperCoolValidator.addRules([rules.minLength(2), rules.maxLength(8)])
mySuperCoolValidator.addRule(rules.isString)

// How about a custom rule?
const customRule = {
  runWithValue: value => {
    if (value !== '🤪') return false
    return true
  },
  message: 'Houston, we got a problem',
}
mySuperCoolValidator.addRule(customRule)

// Okay let's start validating
const { success, failed } = mySuperCoolValidator.runWithValue('hello')
if (success) {
  console.log('Wow, this was validated just like that')
} else {
  const { message } = failed
  console.log(`Okay so here's the error message: ${failed}`)
}

API

Table of Contents
  • sayHello

sayHello

This function says hello.

Parameters

  • name string Some name to say hello for.

Returns string The hello.

License

MIT © Jesse Onolememen

Keywords

FAQs

Package last updated on 13 Mar 2019

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