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.8.0 to 0.9.0

2

doc/example/assigned-rule.js

@@ -6,3 +6,3 @@ // assign a function to a rule

expected: 'foo',
validator: function(cb) {
test: function(cb) {
if(this.value !== this.expected) {

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

@@ -56,3 +56,3 @@ ## Guide

foo: 'bar',
validator: function(cb) {
test: function(cb) {
console.log(this.foo);

@@ -180,2 +180,6 @@ // if this.value has error condition call this.raise()

##### Test
The test function to use for rule validation.
##### Additional

@@ -182,0 +186,0 @@

@@ -109,6 +109,6 @@ var iterator = require('./iterator')

if(typeof rule === 'function') {
rule.validator = rule;
}else if(typeof rule.validator !== 'function') {
rule.test = rule;
}else if(typeof rule.test !== 'function') {
// validator plugin functions are static methods
rule.validator = Rule[rule.type];
rule.test = Rule[rule.type];
}

@@ -119,3 +119,3 @@

if(typeof rule.validator !== 'function') {
if(typeof rule.test !== 'function') {
throw new Error(format('Unknown rule type %s', rule.type));

@@ -256,3 +256,3 @@ }

// invoke rule validation function
rule.validator.call(validator, onValidate);
rule.test.call(validator, onValidate);

@@ -259,0 +259,0 @@ }, function(err, results) {

{
"name": "async-validate",
"description": "Asynchronous validation for node and the browser",
"version": "0.8.0",
"version": "0.9.0",
"author": "muji <noop@xpm.io>",

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

@@ -20,2 +20,3 @@ Table of Contents

* [Type Identifier](#type-identifier)
* [Test](#test)
* [Additional](#additional)

@@ -80,3 +81,3 @@ * [Fields](#fields)

* [Developer](#developer)
* [Test](#test)
* [Test](#test-1)
* [Spec](#spec)

@@ -185,3 +186,3 @@ * [Cover](#cover)

foo: 'bar',
validator: function(cb) {
test: function(cb) {
console.log(this.foo);

@@ -309,2 +310,6 @@ // if this.value has error condition call this.raise()

##### Test
The test function to use for rule validation.
##### Additional

@@ -821,3 +826,3 @@

expected: 'foo',
validator: function(cb) {
test: function(cb) {
if(this.value !== this.expected) {

@@ -824,0 +829,0 @@ this.raise(

@@ -13,3 +13,3 @@ var expect = require('chai').expect

foo: 'bar',
validator: function(cb) {
test: function(cb) {
expect(this.foo).to.eql('bar');

@@ -16,0 +16,0 @@ cb();

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