Socket
Socket
Sign inDemoInstall

anchor

Package Overview
Dependencies
Maintainers
2
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anchor - npm Package Compare versions

Comparing version 0.9.2 to 0.9.3

3

lib/match.js

@@ -75,2 +75,5 @@ /**

}, '');
// If for some reasons the first argument was empty
if(argStr[0] === ',') argStr = argStr.slice(1);
errMsg += 'Validation error: "'+data+'" ';

@@ -77,0 +80,0 @@ errMsg += 'Rule "' + ruleName + '(' + argStr + ')" failed.';

@@ -10,3 +10,3 @@ /**

/**
/**
* Type rules

@@ -18,5 +18,23 @@ */

'empty' : function (x) { return x === ''; },
'required' : function (x) { return check(x).notEmpty(); },
'notEmpty' : function (x) { return check(x).notEmpty(); },
'required' : function (x) {
// Transform data to work properly with node validator
if(!x) x = '';
else if(typeof x.toString !== 'undefined') x = x.toString();
else x = '' + x;
return check(x).notEmpty();
},
'notEmpty' : function (x) {
// Transform data to work properly with node validator
if(!x) x = '';
else if(typeof x.toString !== 'undefined') x = x.toString();
else x = '' + x;
return check(x).notEmpty();
},
'undefined' : _.isUndefined,

@@ -23,0 +41,0 @@

2

package.json
{
"name": "anchor",
"version": "0.9.2",
"version": "0.9.3",
"description": "Recursive validation library with support for objects and lists",

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

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