diff --git a/README.md b/README.md index d4f5d3d..d905f7c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # is.js -![TravisCI](https://img.shields.io/travis/pwnn/is.js.svg?style=flat-square) +![build status](https://img.shields.io/travis/pwnn/is.js.svg?style=flat-square) Minimalistic predicate library. diff --git a/dist/is.min.js b/dist/is.min.js index 3830307..d9e4178 100644 --- a/dist/is.min.js +++ b/dist/is.min.js @@ -1,2 +1,2 @@ -!function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof module&&module.exports?module.exports=b():a.is=b()}(this,function(){var a,b={not:{}},c=Math.floor,d=Object.prototype.toString,e=Object.prototype.hasOwnProperty,f=function(a){var b;return null===a?"null":(b=d.call(a),b.substring(8,b.length-1).toLowerCase())},g=Object.keys||function(a){var b=a.length,c=!{toString:null}.propertyIsEnumerable("toString");return function(d){var f,g,h=[];if(null===d||void 0===d)throw new TypeError("ownKeys called on non-object");for(f in d)e.call(d,f)&&h.push(f);if(c)for(g=0;b>g;g+=1)f=a[g],e.call(d,f)&&h.push(f);return h}}(["toString","toLocaleString","valueOf","isPrototypeOf","hasOwnProperty","propertyIsEnumerable","constructor"]);return a={addPredicate:function(a,c){if(/^(not|use)$/.test(a))throw new Error('"'+a+'" is a reserved name');if(e.call(b,a))throw new Error('predicate "'+a+'" already defined');if("function"!=typeof c)throw new TypeError("predicate must be a function");b[a]=c,b.not[a]=function(){return!c.apply(null,arguments)}}},b.use=function(c){"function"==typeof c&&c(a,b)},b.use(function(a){a.addPredicate("null",function(a){return null===a}),a.addPredicate("undefined",function(a){return void 0===a}),a.addPredicate("exist",function(a){return null!=a}),a.addPredicate("nil",function(a){return null==a})}),b.use(function(a){a.addPredicate("number",function(a){return"number"==typeof a}),a.addPredicate("numeral",function(a){var c=f(a);if("number"!==c&&"string"!==c)return!1;if(b.emptyString(a))return!1;try{a=Number(a)}catch(d){return!1}return b.finite(a)}),a.addPredicate("nan",function(a){return a!==a}),a.addPredicate("odd",function(a){return b.integer(a)&&a%2===1}),a.addPredicate("even",function(a){return b.integer(a)&&a%2===0}),Number.isFinite?a.addPredicate("finite",Number.isFinite):a.addPredicate("finite",function(a){return b.number(a)&&isFinite(a)}),a.addPredicate("infinite",function(a){return a===1/0||a===-1/0}),Number.isInteger?a.addPredicate("integer",Number.isInteger):a.addPredicate("integer",function(a){return b.finite(a)&&c(a)===a}),Number.isSafeInteger?a.addPredicate("safeInteger",Number.isSafeInteger):!function(){var c=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,d=Number.MIN_SAFE_INTEGER||-c;a.addPredicate("safeInteger",function(a){return b.integer(a)&&a>=d&&c>=a})}()}),b.use(function(a){a.addPredicate("string",function(a){return"string"==typeof a}),a.addPredicate("emptyString",function(a){return b.string(a)&&/^\s*$/.test(a)}),a.addPredicate("substring",function(a,c,d){var e;return"string"!==f(c)?!1:(e=c.length,d=b.integer(d)?d:0,0>d&&(d=e+d),0>d||d>=e?!1:-1!==c.indexOf(a,d))}),String.prototype.startsWith&&String.prototype.endsWith?(a.addPredicate("prefix",function(a,b){return"string"===f(b)&&b.startsWith(a)}),a.addPredicate("suffix",function(a,b){return"string"===f(b)&&b.endsWith(a)})):!function(b){a.addPredicate("prefix",b()),a.addPredicate("suffix",b(!0))}(function(a){return function(b,c){var d,e,g,h;if("string"!==f(c))return!1;if(b=String(b),g=b.length,h=c.length,g>h)return!1;for(e=a?h-g:0,d=0;g>d;d+=1)if(c.charCodeAt(e+d)!==b.charCodeAt(d))return!1;return!0}})}),b.use(function(a){a.addPredicate("boolean",function(a){return a===!0||a===!1})}),b.use(function(a){a.addPredicate("object",function(a){return b.not.primitive(a)}),a.addPredicate("emptyObject",function(a){return b.object(a)&&0===g(a).length}),a.addPredicate("propertyDefined",function(a,c){var d,e,f;for(f=a,e=String(c).split(".");d=e.shift();){if(b.not.object(f)||!(d in f))return!1;f=f[d]}return!0}),a.addPredicate("conforms",function(a,c,d){var f,h,i,j,k;if(b.not.object(a)||b.not.object(c))return!1;if(h=g(c),j=h.length,d&&j!==g(a).length)return!1;for(i=0;j>i;i+=1)if(f=h[i],k=c[f],!("function"!=typeof k||e.call(a,f)&&k(a[f],f,a)))return!1;return!0})}),b.use(function(a){Array.isArray?a.addPredicate("array",Array.isArray):a.addPredicate("array",function(a){return"array"===f(a)}),a.addPredicate("arrayLikeObject",function(a){var c;return b.primitive(a)||b["function"](a)?!1:(c=a.length,b.integer(c)&&c>=0&&4294967295>=c)}),a.addPredicate("inArray",function(a,c,d,f){var g,h;if(b.not.arrayLikeObject(c))return!1;if(b["function"](d)?(f=d,d=0):(d=b.integer(d)?d:0,f=b["function"](f)?f:b.equal),h=c.length,0>d&&(d=h+d),0>d||d>=h)return!1;for(g=d;h>g;g+=1)if(e.call(c,g)&&f(a,c[g]))return!0;return!1})}),b.use(function(a){a.addPredicate("sameType",function(a,b){return typeof a==typeof b&&f(a)===f(b)}),a.addPredicate("primitive",function(a){return b.nil(a)||b.number(a)||b.string(a)||b["boolean"](a)||b.symbol(a)}),function(b,c){var d,e,f=c.length;for(e=0;f>e;e+=1)d=c[e],a.addPredicate(d,b(d.toLowerCase()))}(function(a){return function(b){return f(b)===a}},["date","error","function","map","regexp","set","symbol"])}),b.use(function(a){a.addPredicate("equal",function(a,b){return a===b||a!==a&&b!==b}),a.addPredicate("deepEqual",function(a,c){return b.not.sameType(a,c)?!1:b.primitive(a)?b.equal(a,c):b.array(a)?a.length!==c.length?!1:function(){var d,e;for(d=0,e=a.length;e>d;d+=1)if(b.not.deepEqual(a[d],c[d]))return!1;return!0}():function(){var d,f,h,i;if(f=g(a),i=f.length,i!==g(c).length)return!1;for(h=0;i>h;h+=1)if(d=f[h],!e.call(c,d)||b.not.deepEqual(a[d],c[d]))return!1;return!0}()})}),b}); +!function(a,b){"function"==typeof define&&define.amd?define(b):"object"==typeof module&&module.exports?module.exports=b():a.is=b()}(this,function(){var a,b={not:{}},c=Object.prototype.toString,d=Object.prototype.hasOwnProperty,e=function(a){var b;return null===a?"null":(b=c.call(a),b.substring(8,b.length-1).toLowerCase())},f=Object.keys||function(a){var b=a.length,c=!{toString:null}.propertyIsEnumerable("toString");return function(e){var f,g,h=[];if(null===e||void 0===e)throw new TypeError("ownKeys called on non-object");for(f in e)d.call(e,f)&&h.push(f);if(c)for(g=0;b>g;g+=1)f=a[g],d.call(e,f)&&h.push(f);return h}}(["toString","toLocaleString","valueOf","isPrototypeOf","hasOwnProperty","propertyIsEnumerable","constructor"]);return a={addPredicate:function(a,c){if(/^(not|use)$/.test(a))throw new Error('"'+a+'" is a reserved name');if(d.call(b,a))throw new Error('predicate "'+a+'" already defined');if("function"!=typeof c)throw new TypeError("predicate must be a function");b[a]=c,b.not[a]=function(){return!c.apply(null,arguments)}}},b.use=function(c){"function"==typeof c&&c(a,b)},b.use(function(a){a.addPredicate("null",function(a){return null===a}),a.addPredicate("undefined",function(a){return void 0===a}),a.addPredicate("exist",function(a){return null!=a}),a.addPredicate("nil",function(a){return null==a})}),b.use(function(a){a.addPredicate("number",function(a){return"number"==typeof a}),a.addPredicate("numeral",function(a){var c=e(a);if("number"!==c&&"string"!==c)return!1;if(b.emptyString(a))return!1;try{a=Number(a)}catch(d){return!1}return b.finite(a)}),a.addPredicate("nan",function(a){return a!==a}),a.addPredicate("odd",function(a){return b.integer(a)&&a%2===1}),a.addPredicate("even",function(a){return b.integer(a)&&a%2===0}),Number.isFinite?a.addPredicate("finite",Number.isFinite):a.addPredicate("finite",function(a){return b.number(a)&&isFinite(a)}),a.addPredicate("infinite",function(a){return a===1/0||a===-1/0}),Number.isInteger?a.addPredicate("integer",Number.isInteger):a.addPredicate("integer",function(a){return b.finite(a)&&Math.floor(a)===a}),Number.isSafeInteger?a.addPredicate("safeInteger",Number.isSafeInteger):!function(){var c=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,d=Number.MIN_SAFE_INTEGER||-c;a.addPredicate("safeInteger",function(a){return b.integer(a)&&a>=d&&c>=a})}()}),b.use(function(a){a.addPredicate("string",function(a){return"string"==typeof a}),a.addPredicate("emptyString",function(a){return b.string(a)&&/^\s*$/.test(a)}),a.addPredicate("substring",function(a,c,d){var f;return"string"!==e(c)?!1:(f=c.length,d=b.integer(d)?d:0,0>d&&(d=f+d),0>d||d>=f?!1:-1!==c.indexOf(a,d))}),String.prototype.startsWith&&String.prototype.endsWith?(a.addPredicate("prefix",function(a,b){return"string"===e(b)&&b.startsWith(a)}),a.addPredicate("suffix",function(a,b){return"string"===e(b)&&b.endsWith(a)})):!function(b){a.addPredicate("prefix",b()),a.addPredicate("suffix",b(!0))}(function(a){return function(b,c){var d,f,g,h;if("string"!==e(c))return!1;if(b=String(b),g=b.length,h=c.length,g>h)return!1;for(f=a?h-g:0,d=0;g>d;d+=1)if(c.charCodeAt(f+d)!==b.charCodeAt(d))return!1;return!0}})}),b.use(function(a){a.addPredicate("boolean",function(a){return a===!0||a===!1})}),b.use(function(a){a.addPredicate("object",function(a){return b.not.primitive(a)}),a.addPredicate("emptyObject",function(a){return b.object(a)&&0===f(a).length}),a.addPredicate("propertyDefined",function(a,c){var d,e,f;for(f=a,e=String(c).split(".");d=e.shift();){if(b.not.object(f)||!(d in f))return!1;f=f[d]}return!0}),a.addPredicate("conforms",function(a,c,e){var g,h,i,j,k;if(b.not.object(a)||b.not.object(c))return!1;if(h=f(c),j=h.length,e&&j!==f(a).length)return!1;for(i=0;j>i;i+=1)if(g=h[i],k=c[g],!("function"!=typeof k||d.call(a,g)&&k(a[g],g,a)))return!1;return!0})}),b.use(function(a){Array.isArray?a.addPredicate("array",Array.isArray):a.addPredicate("array",function(a){return"array"===e(a)}),a.addPredicate("arrayLikeObject",function(a){var c;return b.primitive(a)||b["function"](a)?!1:(c=a.length,b.integer(c)&&c>=0&&4294967295>=c)}),a.addPredicate("inArray",function(a,c,e,f){var g,h;if(b.not.arrayLikeObject(c))return!1;if(b["function"](e)?(f=e,e=0):(e=b.integer(e)?e:0,f=b["function"](f)?f:b.equal),h=c.length,0>e&&(e=h+e),0>e||e>=h)return!1;for(g=e;h>g;g+=1)if(d.call(c,g)&&f(a,c[g]))return!0;return!1})}),b.use(function(a){a.addPredicate("sameType",function(a,b){return typeof a==typeof b&&e(a)===e(b)}),a.addPredicate("primitive",function(a){return b.nil(a)||b.number(a)||b.string(a)||b["boolean"](a)||b.symbol(a)}),function(b,c){var d,e,f=c.length;for(e=0;f>e;e+=1)d=c[e],a.addPredicate(d,b(d.toLowerCase()))}(function(a){return function(b){return e(b)===a}},["date","error","function","map","regexp","set","symbol"])}),b.use(function(a){a.addPredicate("equal",function(a,b){return a===b||a!==a&&b!==b}),a.addPredicate("deepEqual",function(a,c){return b.not.sameType(a,c)?!1:b.primitive(a)?b.equal(a,c):b.array(a)?a.length!==c.length?!1:function(){var d,e;for(d=0,e=a.length;e>d;d+=1)if(b.not.deepEqual(a[d],c[d]))return!1;return!0}():function(){var e,g,h,i;if(g=f(a),i=g.length,i!==f(c).length)return!1;for(h=0;i>h;h+=1)if(e=g[h],!d.call(c,e)||b.not.deepEqual(a[e],c[e]))return!1;return!0}()})}),b}); //# sourceMappingURL=is.min.map \ No newline at end of file diff --git a/dist/is.min.map b/dist/is.min.map index 1fc6f17..540f110 100644 --- a/dist/is.min.map +++ b/dist/is.min.map @@ -1 +1 @@ -{"version":3,"sources":["../lib/is.js"],"names":["root","factory","define","amd","module","exports","is","this","util","not","floor","Math","toString","Object","prototype","hasOwnProperty","getTag","value","rawTag","call","substring","length","toLowerCase","ownKeys","keys","dontEnums","dontEnumsLength","hasDontEnumBug","propertyIsEnumerable","object","key","index","TypeError","push","addPredicate","name","predicate","test","Error","apply","arguments","use","bundle","tag","emptyString","Number","error","finite","number","integer","isFinite","isInteger","isSafeInteger","MAX","MAX_SAFE_INTEGER","pow","MIN","MIN_SAFE_INTEGER","string","offset","indexOf","String","startsWith","endsWith","prefix","suffix","makePredicate","affix","affixLength","stringLength","charCodeAt","primitive","path","context","split","shift","schema","strict","validator","Array","isArray","array","comparator","arrayLikeObject","equal","other","nil","symbol","tags","sameType","deepEqual"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3,"sources":["../lib/is.js"],"names":["root","factory","define","amd","module","exports","is","this","util","not","toString","Object","prototype","hasOwnProperty","getTag","value","rawTag","call","substring","length","toLowerCase","ownKeys","keys","dontEnums","dontEnumsLength","hasDontEnumBug","propertyIsEnumerable","object","key","index","TypeError","push","addPredicate","name","predicate","test","Error","apply","arguments","use","bundle","tag","emptyString","Number","error","finite","number","integer","isFinite","isInteger","Math","floor","isSafeInteger","MAX","MAX_SAFE_INTEGER","pow","MIN","MIN_SAFE_INTEGER","string","offset","indexOf","String","startsWith","endsWith","prefix","suffix","makePredicate","affix","affixLength","stringLength","charCodeAt","primitive","path","context","split","shift","schema","strict","validator","Array","isArray","array","comparator","arrayLikeObject","equal","other","nil","symbol","tags","sameType","deepEqual"],"mappings":"CAMA,SAAaA,EAAOC,GAEK,kBAAXC,SAAyBA,OAAOC,IAG1CD,OAAQD,GAEoB,gBAAXG,SAAuBA,OAAOC,QAI/CD,OAAOC,QAAUJ,IAKjBD,EAAKM,GAAKL,KAITM,KAAO,WAEV,GACIC,GADAF,GAAOG,QAGPC,EAAWC,OAAOC,UAAUF,SAC5BG,EAAiBF,OAAOC,UAAUC,eAUlCC,EAAS,SAAiBC,GAE5B,GAAIC,EAEJ,OAAe,QAAVD,EAEI,QAEPC,EAASN,EAASO,KAAMF,GACjBC,EAAOE,UAAW,EAAIF,EAAOG,OAAS,GAAIC,gBAYjDC,EAAUV,OAAOW,MAAQ,SAAaC,GAExC,GAAIC,GAAkBD,EAAUJ,OAC5BM,IAAoBf,SAAW,MAAOgB,qBAAsB,WAEhE,OAAO,UAAkBC,GAEvB,GAAIC,GAEAC,EADAP,IAGJ,IAAgB,OAAXK,GAA8B,SAAXA,EACtB,KAAM,IAAIG,WAAW,+BAGvB,KAAMF,IAAOD,GACNd,EAAeI,KAAMU,EAASC,IACjCN,EAAKS,KAAMH,EAKf,IAAKH,EACH,IAAMI,EAAQ,EAAYL,EAARK,EAA0BA,GAAS,EACnDD,EAAML,EAAWM,GACZhB,E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