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.1.11 to 0.1.12

6

lib/rule/date.js

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

}
var dt = moment(Date.parse(value), rule.format);
var dt = !rule.format ? moment(new Date(value)) : moment(value, rule.format);
//console.log('value %s', value);
//console.log('format %s', rule.format);
//console.log('date %s', dt);
//console.log('date valid %s', dt.isValid());
if(!dt) {

@@ -24,0 +28,0 @@ errors.push(error(rule,

@@ -16,2 +16,4 @@ var util = require('util');

var pattern = function(rule, value, source, errors, options) {
//console.log('testing pattern %s', value);
//console.log('testing with rule %s', rule.pattern);
if(rule.pattern instanceof RegExp) {

@@ -18,0 +20,0 @@ if(!rule.pattern.test(value)) {

2

package.json
{
"name": "async-validate",
"description": "Asynchronous validation for object properties.",
"version": "0.1.11",
"version": "0.1.12",
"author": "muji <noop@xpm.io>",

@@ -6,0 +6,0 @@ "repository": {

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

validator.validate({active: "13-06-24"}, function(errors, fields) {
assert.equal(errors.length, 2);
//console.log(errors);
assert.equal(errors.length, 1);
assert.equal(errors[0].message,

@@ -54,0 +53,0 @@ "active value 13-06-24 does not match pattern " + ptn);

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