Socket
Socket
Sign inDemoInstall

checkmate

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    checkmate

lightweight data validation helper


Version published
Weekly downloads
18
increased by1700%
Maintainers
1
Install size
3.20 kB
Created
Weekly downloads
 

Readme

Source

checkmate

Build Status npm version

Checkmate is a very simple data validator.

Use cases

  • form input validation
  • model validation

Characteristics

Example

See the react + is_js example.

import checkmate from 'checkmate'
import is from 'is_js'

const checkers = checkmate({
  email: {
    notEmpty: (str) => !is.empty(str),
    isEmail: is.email,
  },
  password: {
    truthy: (str) => !!str,
    minLength: (str) => str && str.length > 7,
  },
})

const errors = checkers({
  email: 'arnaud@efounderscom',
  password: false,
})

console.log(errors)

// → { email: ['isEmail'], password: ['truthy'] }

Keywords

FAQs

Last updated on 17 Jan 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc