Comparing version 0.10.2 to 0.10.3
@@ -21,3 +21,3 @@ /** | ||
// if args is an array we need to make it a nested array | ||
if (Array.isArray(args)) { | ||
if (Array.isArray(args) && ruleName !== 'len') { | ||
args = [args]; | ||
@@ -24,0 +24,0 @@ } |
@@ -7,2 +7,3 @@ /** | ||
var validator = require('validator'); | ||
var GeoJSON = require('gjtk'); | ||
@@ -21,3 +22,3 @@ | ||
// Transform data to work properly with node validator | ||
if(!x && x !== 0) x = ''; | ||
if(!x && x !== 0 && x !== false) x = ''; | ||
else if(typeof x.toString !== 'undefined') x = x.toString(); | ||
@@ -50,3 +51,5 @@ else x = '' + x; | ||
}, | ||
'geojson' : GeoJSON.isGeoJSON, | ||
'mediumtext' : _.isString, | ||
'longtext' : _.isString, | ||
'text' : _.isString, | ||
@@ -92,3 +95,3 @@ 'string' : _.isString, | ||
'hexadecimal': validator.hexadecimal, | ||
'hexadecimal': validator.isHexadecimal, | ||
'hexColor': validator.isHexColor, | ||
@@ -106,3 +109,3 @@ | ||
'notContains': function (x, str) { return !validator.contains(x, str); }, | ||
'len' : function (x, min, max) { return validator.len(x, min, max); }, | ||
'len' : function (x, min, max) { return validator.isLength(x, min, max); }, | ||
'in' : validator.isIn, | ||
@@ -109,0 +112,0 @@ 'notIn' : function (x, arrayOrString) { return !validator.isIn(x, arrayOrString); }, |
{ | ||
"name": "anchor", | ||
"version": "0.10.2", | ||
"version": "0.10.3", | ||
"description": "Recursive validation library with support for objects and lists", | ||
@@ -24,3 +24,3 @@ "homepage": "http://sailsjs.org", | ||
"scripts": { | ||
"test": "echo Running tests... && mocha --globals testRule" | ||
"test": "make test" | ||
}, | ||
@@ -35,4 +35,5 @@ "repository": { | ||
"dependencies": { | ||
"validator": "~3.22.0", | ||
"lodash": "~2.4.1" | ||
"validator": "~3.40.0", | ||
"lodash": "~3.9.3", | ||
"gjtk": "~1.0.0b" | ||
}, | ||
@@ -39,0 +40,0 @@ "devDependencies": { |
anchor | ||
====== | ||
[![Build Status](https://travis-ci.org/balderdashy/anchor.svg?branch=master)](https://travis-ci.org/balderdashy/anchor) | ||
[![npm version](https://badge.fury.io/js/anchor.svg)](http://badge.fury.io/js/anchor) | ||
[![Dependency Status](https://david-dm.org/balderdashy/anchor.svg)](https://david-dm.org/balderdashy/anchor) | ||
@@ -4,0 +7,0 @@ Anchor is a javascript library that lets you define strict types. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31434
11
551
458
3
+ Addedgjtk@~1.0.0b
+ Addedgjtk@1.0.0-b(transitive)
+ Addedlodash@3.9.3(transitive)
+ Addedpoint-in-polygon@0.0.0(transitive)
+ Addeduri-js@1.4.2(transitive)
+ Addedvalidator@3.40.1(transitive)
- Removedlodash@2.4.2(transitive)
- Removedvalidator@3.22.2(transitive)
Updatedlodash@~3.9.3
Updatedvalidator@~3.40.0