Socket
Socket
Sign inDemoInstall

revalidator

Package Overview
Dependencies
0
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.5 to 0.1.6

19

lib/revalidator.js

@@ -114,3 +114,3 @@ (function (exports) {

'time': /^\d{2}:\d{2}:\d{2}$/,
'color': /^#[a-z0-9]{6}|#[a-z0-9]{3}|(?:rgb\(\s*(?:[+-]?\d+%?)\s*,\s*(?:[+-]?\d+%?)\s*,\s*(?:[+-]?\d+%?)\s*\))aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|and yellow$/i,
'color': /^#[a-z0-9]{6}|#[a-z0-9]{3}|(?:rgb\(\s*(?:[+-]?\d+%?)\s*,\s*(?:[+-]?\d+%?)\s*,\s*(?:[+-]?\d+%?)\s*\))aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow$/i,
//'style': (not supported)

@@ -233,3 +233,3 @@ //'phone': (not supported)

if (value === undefined) {
if (value === undefined || value === '') {
if (schema.required && schema.type !== 'any') {

@@ -300,3 +300,3 @@ return error('required', property, undefined, schema, errors);

constrain('conform', value, function (a, e) { return e(a) });
constrain('conform', value, function (a, e) { return e(a, object) });

@@ -376,2 +376,3 @@ switch (type || (isArray(value) ? 'array' : typeof value)) {

type === 'boolean'? typeof val === 'boolean' :
type === 'date' ? isDate(val) :
type === 'any' ? typeof val !== 'undefined' : false) {

@@ -412,3 +413,15 @@ return callback(null, type);

function isDate(value) {
var s = typeof value;
if (s === 'object') {
if (value) {
if (typeof value.getTime === 'function') {
return true;
}
}
}
return false;
}
})(typeof(window) === 'undefined' ? module.exports : (window.json = window.json || {}));

4

package.json
{
"name": "revalidator",
"version": "0.1.5",
"version": "0.1.6",
"description": "A cross-browser / node.js validator used by resourceful",

@@ -15,3 +15,3 @@ "author": "Nodejitsu Inc. <info@nodejitsu.com>",

"devDependencies": {
"vows": "0.6.x"
"vows": "0.7.0"
},

@@ -18,0 +18,0 @@ "main": "./lib/revalidator",

@@ -93,2 +93,3 @@ var assert = require('assert'),

"with <type>:'any'": assertValidates (9, { type: "any" }),
"with <type>:'date'": assertValidates (new Date(), 'hello', { type: "date" }),
"with <pattern>": assertValidates ("kaboom", "42", { pattern: /^[a-z]+$/ }),

@@ -235,2 +236,5 @@ "with <maxLength>": assertValidates ("boom", "kaboom", { maxLength: 4 }),

return val == val.split("").reverse().join(""); }
},
name: { type: 'string', default: '', conform: function(val, data) {
return (val === data.author); }
}

@@ -255,2 +259,3 @@ },

palindrome: 'dennis sinned',
name: 'cloudhead',
_flag: true

@@ -257,0 +262,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc