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

check-more-types

Package Overview
Dependencies
Maintainers
3
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-more-types - npm Package Compare versions

Comparing version 2.11.0 to 2.11.1

2

check-more-types.js

@@ -37,3 +37,3 @@ (function checkMoreTypes() {

function unemptyString(x) {
return isString(x) && x;
return isString(x) && Boolean(x);
}

@@ -40,0 +40,0 @@ function isObject(x) {

@@ -5,2 +5,2 @@ /*! check-more-types - v0.0.0

!function(){"use strict";function a(a,b){return function(c){if(b&&arguments.length>2)throw new Error("Curry2 function "+a.name+" called with too many arguments "+arguments.length);return 2===arguments.length?a(arguments[0],arguments[1]):function(b){return a(c,b)}}}function b(a){return"function"==typeof a}function c(a){return"string"==typeof a}function d(a){return c(a)&&a}function e(a){return"object"==typeof a&&!Array.isArray(a)&&!j(a)&&!m(a)}function f(a){return e(a)&&0===Object.keys(a).length}function g(a){return"number"==typeof a&&!isNaN(a)&&a!==1/0&&a!==-(1/0)}function h(a){return g(a)&&a%1===0}function i(a){return g(a)&&a%1!==0}function j(a){return null===a}function k(a){return g(a)&&a>0}function l(a){return g(a)&&0>a}function m(a){return a instanceof Date}function n(a){return a instanceof RegExp}function o(a){return a instanceof Error}function p(a,b){return a instanceof b}function q(a,b){return"number"==typeof a&&"number"!=typeof b?q(b,a):(Array.isArray(a)||c(a))&&a.length===b}function r(a){return a>=0}function s(a,b){return c(a)&&c(b)&&0===b.indexOf(a)}function t(a,b){return typeof b===a}function u(a){return c(a)&&ia(a)}function v(a){return c(a)&&ja(a)}function w(a){return c(a)&&(ia(a)||ja(a))}function x(a){var b,c;for(b in a)if(a.hasOwnProperty(b)){if(c=a[b],e(c)&&x(c)===!1)return!1;if(c===!1)return!1}return!0}function y(a,c){var d,f,g={};for(d in c)c.hasOwnProperty(d)&&(f=c[d],b(f)?g[d]=f(a[d]):e(f)&&(g[d]=y(a[d],f)));return g}function z(a){return"undefined"!=typeof a}function A(a){return ka.date(a)&&ka.number(Number(a))}function B(a){return ka.unemptyString(a)&&/^\d+\.\d+\.\d+$/.test(a)}function C(a){var b=typeof a;return"number"===b||"boolean"===b||"string"===b||"symbol"===b}function D(a){return"number"==typeof a&&0===a}function E(a,b){return a===b}function F(a,b){return z(a)&&M(a,"length")&&b>=0&&b<a.length}function G(a,b){return typeof a==typeof b&&a&&b&&a.length===b.length}function H(a){if(!ka.array(a))return!1;if(!a.length)return!0;var b=a[0];return a.every(function(a){return a===b})}function I(a,b){return ka.verify.array(a,"expected an array"),-1!==a.indexOf(b)}function J(a){return ka.unemptyString(a)&&/^git@/.test(a)}function K(a){return 0===a||1===a}function L(a){return"boolean"==typeof a}function M(a,b){if(2!==arguments.length)throw new Error("Expected two arguments to check.has, got only "+arguments.length);return Boolean(a&&b&&"string"==typeof b&&"undefined"!=typeof a[b])}function N(a){return ka.string(a)&&a.toLowerCase()===a}function O(a){return ka.array(a)&&a.length>0}function P(a,b){return ka.array(b)&&b.every(a)}function Q(a,b){return ka.verify.array(b,"expected array to find bad items"),b.filter(fa(a))}function R(a,b){var c=ka.array(a)&&a.every(ka.string);return c&&ka.bool(b)&&b?a.every(ka.lowerCase):c}function S(a,b){return ka.array(a)&&a.every(function(a){return ka.arrayOfStrings(a,b)})}function T(a,b){return ka.verify.fn(ka.every,"missing check.every method"),ka.verify.fn(ka.map,"missing check.map method"),ka.verify.object(a,"missing object to check"),ka.verify.object(b,"missing predicates object"),Object.keys(b).forEach(function(a){if(!ka.fn(b[a]))throw new Error("not a predicate function for "+a+" but "+b[a])}),ka.every(ka.map(a,b))}function U(a,b){return T(b,a)}function V(a,b){ka.verify.fn(a,"expected function that raises");try{a()}catch(c){return"undefined"==typeof b?!0:"function"==typeof b?b(c):!1}return!1}function W(a){return""===a}function X(a){var b="string"==typeof a||Array.isArray(a);return b?!a.length:a instanceof Object?!Object.keys(a).length:!1}function Y(a){var b="string"==typeof a||Array.isArray(a);return b?a.length:a instanceof Object?Object.keys(a).length:!0}function Z(a){return ka.positive(a)&&65535>=a}function $(a){return ka.positive(a)&&1024>=a}function _(a){return ka.number(a)&&a>=0&&1>=a}function aa(a){return ka.string(a)&&la.test(a)}function ba(a){return ka.string(a)&&40===a.length&&ma.test(a)}function ca(a){return ka.string(a)&&7===a.length&&na.test(a)}function da(){var a=Array.prototype.slice.call(arguments,0);if(!a.length)throw new Error("empty list of arguments to or");return function(){var b=Array.prototype.slice.call(arguments,0);return a.some(function(a){try{return ka.fn(a)?a.apply(null,b):Boolean(a)}catch(c){return!1}})}}function ea(){var a=Array.prototype.slice.call(arguments,0);if(!a.length)throw new Error("empty list of arguments to or");return function(){var b=Array.prototype.slice.call(arguments,0);return a.every(function(a){return ka.fn(a)?a.apply(null,b):Boolean(a)})}}function fa(a){return function(){return!a.apply(null,arguments)}}function ga(a){return ka.object(a)&&qa(a)}function ha(a,b){return a===b}if("function"!=typeof Function.prototype.bind)throw new Error("Missing Function.prototype.bind, please load es5-shim first");var ia=s.bind(null,"http://"),ja=s.bind(null,"https://"),ka={maybe:{},verify:{},not:{},every:x,map:y},la=/^#(?:[0-9a-fA-F]{3}){1,2}$/,ma=/^[0-9a-f]{40}$/,na=/^[0-9a-f]{7}$/;if(!ka.defend){var oa=function(a,b,c){ka.verify.fn(a,"expected a function"),ka.verify.array(b,"expected list of predicates"),ka.verify.defined(c,"missing args");var d=0,e=0,f=b.length;for(d=0;f>d;d+=1){var g=b[d];if(ka.fn(g)){if(!g.call(null,c[e])){var h="Argument "+(e+1)+": "+c[e]+" does not pass predicate";throw ka.unemptyString(b[d+1])&&(h+=": "+b[d+1]),new Error(h)}e+=1}}return a.apply(null,c)};ka.defend=function(a){var b=Array.prototype.slice.call(arguments,1);return function(){return oa(a,b,arguments)}}}ka.mixin||(ka.mixin=function(a,f){function g(a,c,f){if(!e(a))throw new Error("missing object "+a);if(!d(c))throw new Error("missing name");if(!b(f))throw new Error("missing function");a[c]||(a[c]=f)}function h(a){return function(){return!ka.defined(arguments[0])||ka.nulled(arguments[0])?!0:a.apply(null,arguments)}}function i(a,b){return function(){var c;if(a.apply(null,arguments)===!1)throw c=arguments[arguments.length-1],new Error(ka.unemptyString(c)?c:b)}}if(c(a)&&b(f)){var j=a;a=f,f=j}if(!b(a))throw new Error("expected predicate function");if(d(f)||(f=a.name),!d(f))throw new Error("predicate function missing name\n"+a.toString());g(ka,f,a),g(ka.maybe,f,h(a)),g(ka.not,f,fa(a)),g(ka.verify,f,i(a,f+" failed"))}),ka.then||(ka.then=function(a,b){return function(){var c="function"==typeof a?a.apply(null,arguments):a;return c?b.apply(null,arguments):void 0}});var pa={then:b};pa["catch"]=b,pa["finally"]=b;var qa=U.bind(null,pa),ra={nulled:j,fn:b,string:c,unemptyString:d,object:e,number:g,array:Array.isArray,positiveNumber:k,negativeNumber:l,positive:k,negative:l,defined:z,same:E,allSame:H,bit:K,bool:L,has:M,lowerCase:N,unemptyArray:O,arrayOfStrings:R,arrayOfArraysOfStrings:S,all:T,schema:a(U),raises:V,empty:X,found:r,emptyString:W,unempty:Y,unit:_,hexRgb:aa,sameLength:G,commitId:ba,shortCommitId:ca,index:F,git:J,arrayOf:P,badItems:Q,oneOf:a(I,!0),promise:ga,validDate:A,equal:a(ha),or:da,and:ea,primitive:C,zero:D,date:m,regexp:n,instance:p,emptyObject:f,length:a(q),floatNumber:i,intNumber:h,startsWith:s,webUrl:w,semver:B,type:a(t),http:u,https:v,secure:v,error:o,port:Z,systemPort:$};Object.keys(ra).forEach(function(a){ka.mixin(ra[a],a)}),"object"==typeof module&&(module.exports=ka),"object"==typeof window&&(window.check=ka),"object"==typeof global&&(global.check=ka)}();
!function(){"use strict";function a(a,b){return function(c){if(b&&arguments.length>2)throw new Error("Curry2 function "+a.name+" called with too many arguments "+arguments.length);return 2===arguments.length?a(arguments[0],arguments[1]):function(b){return a(c,b)}}}function b(a){return"function"==typeof a}function c(a){return"string"==typeof a}function d(a){return c(a)&&Boolean(a)}function e(a){return"object"==typeof a&&!Array.isArray(a)&&!j(a)&&!m(a)}function f(a){return e(a)&&0===Object.keys(a).length}function g(a){return"number"==typeof a&&!isNaN(a)&&a!==1/0&&a!==-(1/0)}function h(a){return g(a)&&a%1===0}function i(a){return g(a)&&a%1!==0}function j(a){return null===a}function k(a){return g(a)&&a>0}function l(a){return g(a)&&0>a}function m(a){return a instanceof Date}function n(a){return a instanceof RegExp}function o(a){return a instanceof Error}function p(a,b){return a instanceof b}function q(a,b){return"number"==typeof a&&"number"!=typeof b?q(b,a):(Array.isArray(a)||c(a))&&a.length===b}function r(a){return a>=0}function s(a,b){return c(a)&&c(b)&&0===b.indexOf(a)}function t(a,b){return typeof b===a}function u(a){return c(a)&&ia(a)}function v(a){return c(a)&&ja(a)}function w(a){return c(a)&&(ia(a)||ja(a))}function x(a){var b,c;for(b in a)if(a.hasOwnProperty(b)){if(c=a[b],e(c)&&x(c)===!1)return!1;if(c===!1)return!1}return!0}function y(a,c){var d,f,g={};for(d in c)c.hasOwnProperty(d)&&(f=c[d],b(f)?g[d]=f(a[d]):e(f)&&(g[d]=y(a[d],f)));return g}function z(a){return"undefined"!=typeof a}function A(a){return ka.date(a)&&ka.number(Number(a))}function B(a){return ka.unemptyString(a)&&/^\d+\.\d+\.\d+$/.test(a)}function C(a){var b=typeof a;return"number"===b||"boolean"===b||"string"===b||"symbol"===b}function D(a){return"number"==typeof a&&0===a}function E(a,b){return a===b}function F(a,b){return z(a)&&M(a,"length")&&b>=0&&b<a.length}function G(a,b){return typeof a==typeof b&&a&&b&&a.length===b.length}function H(a){if(!ka.array(a))return!1;if(!a.length)return!0;var b=a[0];return a.every(function(a){return a===b})}function I(a,b){return ka.verify.array(a,"expected an array"),-1!==a.indexOf(b)}function J(a){return ka.unemptyString(a)&&/^git@/.test(a)}function K(a){return 0===a||1===a}function L(a){return"boolean"==typeof a}function M(a,b){if(2!==arguments.length)throw new Error("Expected two arguments to check.has, got only "+arguments.length);return Boolean(a&&b&&"string"==typeof b&&"undefined"!=typeof a[b])}function N(a){return ka.string(a)&&a.toLowerCase()===a}function O(a){return ka.array(a)&&a.length>0}function P(a,b){return ka.array(b)&&b.every(a)}function Q(a,b){return ka.verify.array(b,"expected array to find bad items"),b.filter(fa(a))}function R(a,b){var c=ka.array(a)&&a.every(ka.string);return c&&ka.bool(b)&&b?a.every(ka.lowerCase):c}function S(a,b){return ka.array(a)&&a.every(function(a){return ka.arrayOfStrings(a,b)})}function T(a,b){return ka.verify.fn(ka.every,"missing check.every method"),ka.verify.fn(ka.map,"missing check.map method"),ka.verify.object(a,"missing object to check"),ka.verify.object(b,"missing predicates object"),Object.keys(b).forEach(function(a){if(!ka.fn(b[a]))throw new Error("not a predicate function for "+a+" but "+b[a])}),ka.every(ka.map(a,b))}function U(a,b){return T(b,a)}function V(a,b){ka.verify.fn(a,"expected function that raises");try{a()}catch(c){return"undefined"==typeof b?!0:"function"==typeof b?b(c):!1}return!1}function W(a){return""===a}function X(a){var b="string"==typeof a||Array.isArray(a);return b?!a.length:a instanceof Object?!Object.keys(a).length:!1}function Y(a){var b="string"==typeof a||Array.isArray(a);return b?a.length:a instanceof Object?Object.keys(a).length:!0}function Z(a){return ka.positive(a)&&65535>=a}function $(a){return ka.positive(a)&&1024>=a}function _(a){return ka.number(a)&&a>=0&&1>=a}function aa(a){return ka.string(a)&&la.test(a)}function ba(a){return ka.string(a)&&40===a.length&&ma.test(a)}function ca(a){return ka.string(a)&&7===a.length&&na.test(a)}function da(){var a=Array.prototype.slice.call(arguments,0);if(!a.length)throw new Error("empty list of arguments to or");return function(){var b=Array.prototype.slice.call(arguments,0);return a.some(function(a){try{return ka.fn(a)?a.apply(null,b):Boolean(a)}catch(c){return!1}})}}function ea(){var a=Array.prototype.slice.call(arguments,0);if(!a.length)throw new Error("empty list of arguments to or");return function(){var b=Array.prototype.slice.call(arguments,0);return a.every(function(a){return ka.fn(a)?a.apply(null,b):Boolean(a)})}}function fa(a){return function(){return!a.apply(null,arguments)}}function ga(a){return ka.object(a)&&qa(a)}function ha(a,b){return a===b}if("function"!=typeof Function.prototype.bind)throw new Error("Missing Function.prototype.bind, please load es5-shim first");var ia=s.bind(null,"http://"),ja=s.bind(null,"https://"),ka={maybe:{},verify:{},not:{},every:x,map:y},la=/^#(?:[0-9a-fA-F]{3}){1,2}$/,ma=/^[0-9a-f]{40}$/,na=/^[0-9a-f]{7}$/;if(!ka.defend){var oa=function(a,b,c){ka.verify.fn(a,"expected a function"),ka.verify.array(b,"expected list of predicates"),ka.verify.defined(c,"missing args");var d=0,e=0,f=b.length;for(d=0;f>d;d+=1){var g=b[d];if(ka.fn(g)){if(!g.call(null,c[e])){var h="Argument "+(e+1)+": "+c[e]+" does not pass predicate";throw ka.unemptyString(b[d+1])&&(h+=": "+b[d+1]),new Error(h)}e+=1}}return a.apply(null,c)};ka.defend=function(a){var b=Array.prototype.slice.call(arguments,1);return function(){return oa(a,b,arguments)}}}ka.mixin||(ka.mixin=function(a,f){function g(a,c,f){if(!e(a))throw new Error("missing object "+a);if(!d(c))throw new Error("missing name");if(!b(f))throw new Error("missing function");a[c]||(a[c]=f)}function h(a){return function(){return!ka.defined(arguments[0])||ka.nulled(arguments[0])?!0:a.apply(null,arguments)}}function i(a,b){return function(){var c;if(a.apply(null,arguments)===!1)throw c=arguments[arguments.length-1],new Error(ka.unemptyString(c)?c:b)}}if(c(a)&&b(f)){var j=a;a=f,f=j}if(!b(a))throw new Error("expected predicate function");if(d(f)||(f=a.name),!d(f))throw new Error("predicate function missing name\n"+a.toString());g(ka,f,a),g(ka.maybe,f,h(a)),g(ka.not,f,fa(a)),g(ka.verify,f,i(a,f+" failed"))}),ka.then||(ka.then=function(a,b){return function(){var c="function"==typeof a?a.apply(null,arguments):a;return c?b.apply(null,arguments):void 0}});var pa={then:b};pa["catch"]=b,pa["finally"]=b;var qa=U.bind(null,pa),ra={nulled:j,fn:b,string:c,unemptyString:d,object:e,number:g,array:Array.isArray,positiveNumber:k,negativeNumber:l,positive:k,negative:l,defined:z,same:E,allSame:H,bit:K,bool:L,has:M,lowerCase:N,unemptyArray:O,arrayOfStrings:R,arrayOfArraysOfStrings:S,all:T,schema:a(U),raises:V,empty:X,found:r,emptyString:W,unempty:Y,unit:_,hexRgb:aa,sameLength:G,commitId:ba,shortCommitId:ca,index:F,git:J,arrayOf:P,badItems:Q,oneOf:a(I,!0),promise:ga,validDate:A,equal:a(ha),or:da,and:ea,primitive:C,zero:D,date:m,regexp:n,instance:p,emptyObject:f,length:a(q),floatNumber:i,intNumber:h,startsWith:s,webUrl:w,semver:B,type:a(t),http:u,https:v,secure:v,error:o,port:Z,systemPort:$};Object.keys(ra).forEach(function(a){ka.mixin(ra[a],a)}),"object"==typeof module&&(module.exports=ka),"object"==typeof window&&(window.check=ka),"object"==typeof global&&(global.check=ka)}();
{
"name": "check-more-types",
"description": "Large collection of predicates.",
"version": "2.11.0",
"version": "2.11.1",
"author": {

@@ -106,3 +106,3 @@ "name": "Gleb Bahmutov",

"size": "tarball=\"$(npm pack .)\"; wc -c \"${tarball}\"; tar tvf \"${tarball}\"; rm \"${tarball}\";",
"test": "npm run node-test && grunt mochaTest:syntheticBrowser",
"test": "npm run node-test && grunt mochaTest:syntheticBrowser && mocha test/check-more-types-spec.js",
"watch": "grunt watch"

@@ -109,0 +109,0 @@ },

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