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

async-validate

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-validate - npm Package Compare versions

Comparing version 0.4.14 to 0.4.15

7

doc/readme/guide.md

@@ -229,3 +229,3 @@ ## Guide

* `object`: Must be of type `object` and not `Array.isArray`.
* `enum`: Value must exist in the `enum`.
* `enum`: Value must exist in the `list`.
* `date`: Value must be valid as determined by `moment().isValid()`.

@@ -275,7 +275,7 @@

To validate a value from a list of possible values use the `enum` type with a `enum` property listing the valid values for the field, for example:
To validate a value from a list of possible values use the `enum` type with a `list` property containing the valid values for the field, for example:
```javascript
var descriptor = {
role: {type: "enum", enum: ['admin', 'user', 'guest']}
role: {type: "enum", list: ['admin', 'user', 'guest']}
}

@@ -313,2 +313,1 @@ ```

You may wish to sanitize user input instead of testing for whitespace, see [transform](#transform) for an example that would allow you to strip whitespace.
{
"name": "async-validate",
"description": "Asynchronous validation for object properties.",
"version": "0.4.14",
"version": "0.4.15",
"author": "muji <noop@xpm.io>",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -9,3 +9,3 @@ /**

this.required();
var list = this.rule.enum;
var list = this.rule.list;
if(list.indexOf(this.value) === -1) {

@@ -12,0 +12,0 @@ this.raise(

@@ -321,3 +321,3 @@ Table of Contents

* `object`: Must be of type `object` and not `Array.isArray`.
* `enum`: Value must exist in the `enum`.
* `enum`: Value must exist in the `list`.
* `date`: Value must be valid as determined by `moment().isValid()`.

@@ -367,7 +367,7 @@

To validate a value from a list of possible values use the `enum` type with a `enum` property listing the valid values for the field, for example:
To validate a value from a list of possible values use the `enum` type with a `list` property containing the valid values for the field, for example:
```javascript
var descriptor = {
role: {type: "enum", enum: ['admin', 'user', 'guest']}
role: {type: "enum", list: ['admin', 'user', 'guest']}
}

@@ -374,0 +374,0 @@ ```

@@ -8,3 +8,3 @@ var util = require('util');

var descriptor = {
role: {type: "enum", enum: ['admin', 'user', 'guest']}
role: {type: "enum", list: ['admin', 'user', 'guest']}
}

@@ -20,3 +20,3 @@ var validator = new schema(descriptor);

var descriptor = {
role: {type: "enum", enum: ['admin', 'user', 'guest']}
role: {type: "enum", list: ['admin', 'user', 'guest']}
}

@@ -23,0 +23,0 @@ var validator = new schema(descriptor);

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