Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

valido

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

valido - npm Package Compare versions

Comparing version 1.0.10 to 1.0.11

dist/index.js

6

dist/validators/isArray.js

@@ -14,6 +14,2 @@ 'use strict';

var tests = [{ value: null, result: false }, { value: undefined, result: false }, {
value: function value() {}, result: false
}, { value: '', result: false }, { value: 1, result: false }, { value: [], result: true }, { value: [123, 456], result: true }, { value: ['a', 123, null], result: true }];
module.exports = { validate: validate, tests: tests };
module.exports = validate;

@@ -14,6 +14,2 @@ 'use strict';

var tests = [{ value: null, result: false }, { value: undefined, result: false }, {
value: function value() {}, result: false
}, { value: '', result: false }, { value: '1', result: false }, { value: 1, result: true }, { value: 1.1, result: true }, { value: -1, result: true }, { value: -1.1, result: true }, { value: Math.PI, result: true }, { value: NaN, result: false }, { value: Infinity, result: false }, { value: -Infinity, result: false }, { value: 2e64, result: true }, { value: Math.pow(2, 2) - 1, result: true }];
module.exports = { validate: validate, tests: tests };
module.exports = validate;
'use strict';
var isString = require('./isString').validate;
var isString = require('./isString');
var re = /^#([0-9A-F]{3}|[0-9A-F]{6})$/i;

@@ -12,3 +12,2 @@

*/
function validate(hexColor) {

@@ -22,6 +21,2 @@ if (!isString(hexColor)) {

var tests = [{ value: null, result: false }, { value: undefined, result: false }, {
value: function value() {}, result: false
}, { value: '', result: false }, { value: 1, result: false }, { value: 'FF3333', result: false }, { value: '#FF33', result: false }, { value: '#FF33333', result: false }, { value: '#FF3333', result: true }, { value: '#FFF', result: true }];
module.exports = { validate: validate, tests: tests };
module.exports = validate;

@@ -14,6 +14,2 @@ 'use strict';

var tests = [{ value: null, result: false }, { value: undefined, result: false }, {
value: function value() {}, result: false
}, { value: '', result: false }, { value: '1', result: false }, { value: 1, result: true }, { value: 1.1, result: false }, { value: -1, result: true }, { value: -1.1, result: false }, { value: Math.PI, result: false }, { value: NaN, result: false }, { value: Infinity, result: false }, { value: -Infinity, result: false }, { value: 2e64, result: true }, { value: Math.pow(2, 2) - 1, result: true }];
module.exports = { validate: validate, tests: tests };
module.exports = validate;

@@ -14,6 +14,2 @@ 'use strict';

var tests = [{ value: null, result: false }, { value: undefined, result: false }, {
value: function value() {}, result: false
}, { value: '', result: false }, { value: '1', result: false }, { value: 1, result: true }, { value: 1.1, result: false }, { value: -1, result: false }, { value: -1.1, result: false }, { value: Math.PI, result: false }, { value: NaN, result: false }, { value: Infinity, result: false }, { value: -Infinity, result: false }, { value: 2e64, result: true }, { value: Math.pow(2, 2) - 1, result: true }];
module.exports = { validate: validate, tests: tests };
module.exports = validate;

@@ -14,6 +14,2 @@ 'use strict';

var tests = [{ value: null, result: true }, { value: undefined, result: false }, {
value: function value() {}, result: false
}, { value: 1, result: false }, { value: [], result: false }, { value: '', result: false }, { value: 'abc', result: false }];
module.exports = { validate: validate, tests: tests };
module.exports = validate;

@@ -14,6 +14,2 @@ 'use strict';

var tests = [{ value: null, result: true }, { value: undefined, result: true }, {
value: function value() {}, result: false
}, { value: 1, result: false }, { value: [], result: false }, { value: '', result: false }, { value: 'abc', result: false }];
module.exports = { validate: validate, tests: tests };
module.exports = validate;

@@ -30,6 +30,2 @@ 'use strict';

var tests = [{ value: null, result: false }, { value: undefined, result: false }, {
value: function value() {}, result: false
}, { value: 1, result: false }, { value: [], result: false }, { value: '', result: true }, { value: 'abc', result: true }, { value: 'abc' + 123, result: true }, { value: 'abc', options: { startsWith: 'a' }, result: true }, { value: 'abc', options: { startsWith: 'b' }, result: false }, { value: 'abc', options: { endsWith: 'c' }, result: true }, { value: 'abc', options: { endsWith: 'd' }, result: false }, { value: 'abc', options: { startsWith: 'b', endsWith: 'c' }, result: false }, { value: 'abc', options: { startsWith: 'a', endsWith: 'd' }, result: false }, { value: 'abc', options: { startsWith: 'a', endsWith: 'c' }, result: true }];
module.exports = { validate: validate, tests: tests };
module.exports = validate;

@@ -14,6 +14,2 @@ 'use strict';

var tests = [{ value: null, result: false }, { value: undefined, result: true }, {
value: function value() {}, result: false
}, { value: 1, result: false }, { value: [], result: false }, { value: '', result: false }, { value: 'abc', result: false }];
module.exports = { validate: validate, tests: tests };
module.exports = validate;
'use strict';
var isString = require('./isString').validate;
var isString = require('./isString');

@@ -75,6 +75,2 @@ // Based on

var tests = [{ value: null, result: false }, { value: undefined, result: false }, {
value: function value() {}, result: false
}, { value: '', result: false }, { value: 1, result: false }, { value: 'abc', result: false }, { value: {}, result: false }, { value: [], result: false }, { value: 'http://', result: false }, { value: '/index.html', result: false }, { value: 'google.com', result: false }, { value: 'https://127.0.0.1:3128', result: false }, { value: 'https://8.8.8.8.8:3128', result: false }, { value: 'mongodb://www.google.com', result: false }, { value: 'http://www.google.com', result: true }, { value: 'http://google.com', result: true }, { value: 'https://www.google.com', result: true }, { value: 'https://8.8.8.8:3128', result: true }, { value: 'https://pass:bob@www.google.com:8080/index.html?param=2&yy=abc', result: true }, { value: 'https://www.google.com', options: { endsWith: '/' }, result: false }, { value: 'https://www.google.com/', options: { endsWith: '/' }, result: true }, { value: 'https://www.google.com', options: { startsWith: 'https://www.ebay' }, result: false }, { value: 'https://www.google.com/', options: { startsWith: 'https://www.google' }, result: true }, { value: 'https://www.google.com/', options: { startsWith: 'https://www.google', endsWith: '/' }, result: true }, { value: 'https://www.google.com', options: { startsWith: 'https://www.google', endsWith: '/' }, result: false }, { value: 'https://www.google.com/', options: { startsWith: 'https://www.ebay', endsWith: '/' }, result: false }];
module.exports = { validate: validate, tests: tests };
module.exports = validate;
{
"name": "valido",
"version": "1.0.10",
"version": "1.0.11",
"description": "Validation provider",
"main": "dist/main.js",
"main": "dist/index.js",
"scripts": {

@@ -7,0 +7,0 @@ "test": "./node_modules/.bin/babel src -d dist && mocha",

@@ -9,3 +9,2 @@ 'use strict';

*/
function validate(value) {

@@ -15,16 +14,2 @@ return Array.isArray(value);

const tests = [
{ value: null, result: false },
{ value: undefined, result: false },
{
value: () => {
}, result: false
},
{ value: '', result: false },
{ value: 1, result: false },
{ value: [], result: true },
{ value: [123, 456], result: true },
{ value: ['a', 123, null], result: true }
];
module.exports = { validate, tests };
module.exports = validate;

@@ -9,3 +9,2 @@ 'use strict';

*/
function validate(value) {

@@ -15,23 +14,2 @@ return Number.isFinite(value);

const tests = [
{ value: null, result: false },
{ value: undefined, result: false },
{
value: () => {
}, result: false
},
{ value: '', result: false },
{ value: '1', result: false },
{ value: 1, result: true },
{ value: 1.1, result: true },
{ value: -1, result: true },
{ value: -1.1, result: true },
{ value: Math.PI, result: true },
{ value: NaN, result: false },
{ value: Infinity, result: false },
{ value: -Infinity, result: false },
{ value: 2e64, result: true },
{ value: Math.pow(2, 2) - 1, result: true }
];
module.exports = { validate, tests };
module.exports = validate;
'use strict';
const isString = require('./isString').validate;
const isString = require('./isString');
const re = /^#([0-9A-F]{3}|[0-9A-F]{6})$/i;

@@ -12,3 +12,2 @@

*/
function validate(hexColor) {

@@ -22,18 +21,2 @@ if (!isString(hexColor)) {

const tests = [
{ value: null, result: false },
{ value: undefined, result: false },
{
value: () => {
}, result: false
},
{ value: '', result: false },
{ value: 1, result: false },
{ value: 'FF3333', result: false },
{ value: '#FF33', result: false },
{ value: '#FF33333', result: false },
{ value: '#FF3333', result: true },
{ value: '#FFF', result: true }
];
module.exports = { validate, tests };
module.exports = validate;

@@ -9,3 +9,2 @@ 'use strict';

*/
function validate(value) {

@@ -15,23 +14,2 @@ return Number.isInteger(value);

const tests = [
{ value: null, result: false },
{ value: undefined, result: false },
{
value: () => {
}, result: false
},
{ value: '', result: false },
{ value: '1', result: false },
{ value: 1, result: true },
{ value: 1.1, result: false },
{ value: -1, result: true },
{ value: -1.1, result: false },
{ value: Math.PI, result: false },
{ value: NaN, result: false },
{ value: Infinity, result: false },
{ value: -Infinity, result: false },
{ value: 2e64, result: true },
{ value: Math.pow(2, 2) - 1, result: true }
];
module.exports = { validate, tests };
module.exports = validate;

@@ -9,3 +9,2 @@ 'use strict';

*/
function validate(value) {

@@ -15,23 +14,2 @@ return Number.isInteger(value) && value >= 0;

const tests = [
{ value: null, result: false },
{ value: undefined, result: false },
{
value: () => {
}, result: false
},
{ value: '', result: false },
{ value: '1', result: false },
{ value: 1, result: true },
{ value: 1.1, result: false },
{ value: -1, result: false },
{ value: -1.1, result: false },
{ value: Math.PI, result: false },
{ value: NaN, result: false },
{ value: Infinity, result: false },
{ value: -Infinity, result: false },
{ value: 2e64, result: true },
{ value: Math.pow(2, 2) - 1, result: true }
];
module.exports = { validate, tests };
module.exports = validate;

@@ -9,3 +9,2 @@ 'use strict';

*/
function validate(value) {

@@ -15,15 +14,2 @@ return value === null;

const tests = [
{ value: null, result: true },
{ value: undefined, result: false },
{
value: () => {
}, result: false
},
{ value: 1, result: false },
{ value: [], result: false },
{ value: '', result: false },
{ value: 'abc', result: false }
];
module.exports = { validate, tests };
module.exports = validate;

@@ -9,3 +9,2 @@ 'use strict';

*/
function validate(value) {

@@ -15,15 +14,2 @@ return value === null || value === undefined;

const tests = [
{ value: null, result: true },
{ value: undefined, result: true },
{
value: () => {
}, result: false
},
{ value: 1, result: false },
{ value: [], result: false },
{ value: '', result: false },
{ value: 'abc', result: false }
];
module.exports = { validate, tests };
module.exports = validate;

@@ -10,3 +10,2 @@ 'use strict';

*/
function validate(value, options) {

@@ -31,23 +30,2 @@ let isString = value instanceof String || typeof value === 'string';

const tests = [
{ value: null, result: false },
{ value: undefined, result: false },
{
value: () => {
}, result: false
},
{ value: 1, result: false },
{ value: [], result: false },
{ value: '', result: true },
{ value: 'abc', result: true },
{ value: 'abc' + 123, result: true },
{ value: 'abc', options: { startsWith: 'a' }, result: true },
{ value: 'abc', options: { startsWith: 'b' }, result: false },
{ value: 'abc', options: { endsWith: 'c' }, result: true },
{ value: 'abc', options: { endsWith: 'd' }, result: false },
{ value: 'abc', options: { startsWith: 'b', endsWith: 'c' }, result: false },
{ value: 'abc', options: { startsWith: 'a', endsWith: 'd' }, result: false },
{ value: 'abc', options: { startsWith: 'a', endsWith: 'c' }, result: true }
];
module.exports = { validate, tests };
module.exports = validate;

@@ -9,3 +9,2 @@ 'use strict';

*/
function validate(value) {

@@ -15,15 +14,2 @@ return value === undefined;

const tests = [
{ value: null, result: false },
{ value: undefined, result: true },
{
value: () => {
}, result: false
},
{ value: 1, result: false },
{ value: [], result: false },
{ value: '', result: false },
{ value: 'abc', result: false }
];
module.exports = { validate, tests };
module.exports = validate;
'use strict';
const isString = require('./isString').validate;
const isString = require('./isString');

@@ -85,34 +85,2 @@ // Based on

const tests = [
{ value: null, result: false },
{ value: undefined, result: false },
{
value: () => {
}, result: false
},
{ value: '', result: false },
{ value: 1, result: false },
{ value: 'abc', result: false },
{ value: {}, result: false },
{ value: [], result: false },
{ value: 'http://', result: false },
{ value: '/index.html', result: false },
{ value: 'google.com', result: false },
{ value: 'https://127.0.0.1:3128', result: false },
{ value: 'https://8.8.8.8.8:3128', result: false },
{ value: 'mongodb://www.google.com', result: false },
{ value: 'http://www.google.com', result: true },
{ value: 'http://google.com', result: true },
{ value: 'https://www.google.com', result: true },
{ value: 'https://8.8.8.8:3128', result: true },
{ value: 'https://pass:bob@www.google.com:8080/index.html?param=2&yy=abc', result: true },
{ value: 'https://www.google.com', options: { endsWith: '/' }, result: false },
{ value: 'https://www.google.com/', options: { endsWith: '/' }, result: true },
{ value: 'https://www.google.com', options: { startsWith: 'https://www.ebay' }, result: false },
{ value: 'https://www.google.com/', options: { startsWith: 'https://www.google' }, result: true },
{ value: 'https://www.google.com/', options: { startsWith: 'https://www.google', endsWith: '/' }, result: true },
{ value: 'https://www.google.com', options: { startsWith: 'https://www.google', endsWith: '/' }, result: false },
{ value: 'https://www.google.com/', options: { startsWith: 'https://www.ebay', endsWith: '/' }, result: false }
];
module.exports = { validate, tests };
module.exports = validate;
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