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

calidation

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

calidation - npm Package Compare versions

Comparing version 1.2.2 to 1.3.0

5

dist/ValidatorsContext.js

@@ -37,3 +37,6 @@ 'use strict';

isRegexMatch: _calidators.isRegexMatch,
isWhitelisted: _calidators.isWhitelisted
isWhitelisted: _calidators.isWhitelisted,
isMinLength: _calidators.isMinLength,
isMaxLength: _calidators.isMaxLength,
isExactLength: _calidators.isExactLength
};

@@ -40,0 +43,0 @@

2

package.json
{
"name": "calidation",
"version": "1.2.2",
"version": "1.3.0",
"description": "A red hot validation library for React",

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

@@ -5,3 +5,3 @@ # calidation

[![Build Status](https://travis-ci.org/selbekk/calidation.svg?branch=master)](https://travis-ci.org/selbekk/calidation) [![codecov](https://codecov.io/gh/selbekk/calidation/branch/master/graph/badge.svg)](https://codecov.io/gh/selbekk/calidation)
[![Build Status](https://travis-ci.org/selbekk/calidation.svg?branch=master)](https://travis-ci.org/selbekk/calidation) [![codecov](https://codecov.io/gh/selbekk/calidation/branch/master/graph/badge.svg)](https://codecov.io/gh/selbekk/calidation) [![npm version](https://badge.fury.io/js/calidators.svg)](https://badge.fury.io/js/calidators)

@@ -17,2 +17,5 @@ ```

I have written [the best blog post](https://medium.com/@selbekk/introducing-calidation-7d9a79453f7)
of all time about this.
## How do you even?

@@ -44,2 +47,6 @@

isRequired: 'Password is also required!',
isMinLength: {
message: 'Password must be 8 characters or longer',
length: 8,
},
},

@@ -191,3 +198,4 @@ };

calidation comes with a lot of validators built in. These should be enough for
most common use-cases.
most common use-cases. You'll find them all in the sister package
[`calidators`](https://github.com/selbekk/calidators).

@@ -299,2 +307,41 @@ #### `isRequired`

#### `isMinLength`
Validates that a field is at least a given number of characters long.
```js
someField: {
isMinLength: {
message: 'You need at least four characters',
length: 4,
},
},
```
#### `isMaxLength`
Validates that a field is at most a given number of characters long.
```js
someField: {
isMaxLength: {
message: 'You can at most have four characters',
length: 4,
},
},
```
#### `isExactLength`
Validates that a field is exactly a given number of characters long.
```js
someField: {
isExactLength: {
message: 'Norwegian postal codes are four digits long',
length: 4,
},
},
```
### Custom validators

@@ -301,0 +348,0 @@

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