Comparing version 1.2.7 to 1.2.8
{ | ||
"name": "types.js", | ||
"version": "1.2.7", | ||
"version": "1.2.8", | ||
"description": "A tiny (1.7kb), but essential Javascript type-check library", | ||
@@ -5,0 +5,0 @@ "main": "types.min.js", |
@@ -34,3 +34,3 @@ // Generated by CoffeeScript 1.8.0 | ||
default: | ||
if (Types["typeof"](value) === type.toLowerCase()) { | ||
if (Types['is' + type](value)) { | ||
return value; | ||
@@ -45,3 +45,3 @@ } | ||
} | ||
if (Types['is' + type](value)) { | ||
if (false !== (value = convertType(value))) { | ||
return value; | ||
@@ -48,0 +48,0 @@ } |
@@ -1,1 +0,1 @@ | ||
(function(){"use strict";var n,t,r,e,u,o;n={parseIntBase:10},e={Boolean:!1,String:"",Number:0,Object:{},Array:[],Function:function(){}},r=function(t){var r;return r=function(r){switch(t){case"Number":if(n.notNaN(r=parseInt(r,n.parseIntBase)))return r;break;case"String":if(n.isStringOrNumber(r))return r+"";break;default:if(n["typeof"](r)===t.toLowerCase())return r}return!1},function(u,o){return null==o&&(o=u),n["is"+t](u)?u:!1!==(o=r(o))?o:e[t]}},u=function(n,t,r){var e,u,i;if(null==r&&(r=[]),r.length<1)return n===o.Undefined?!0:!1;for(u=0,i=r.length;i>u;u++)if(e=r[u],n(e)===t)return t;return!t},o={Undefined:function(n){return void 0===n},Null:function(n){return null===n},Boolean:function(n){return"boolean"==typeof n},String:function(n){return"string"==typeof n},Function:function(n){return"function"==typeof n},Number:function(n){return"number"==typeof n&&n===n},Array:function(n){return"object"==typeof n&&n instanceof Array},RegExp:function(n){return"object"==typeof n&&n instanceof RegExp},Date:function(n){return"object"==typeof n&&n instanceof Date},Object:function(n){return!("object"!=typeof n||n instanceof Array||n instanceof RegExp||n instanceof Date||null===n)},NaN:function(n){return"number"==typeof n&&n!==n}},o.StringOrNumber=function(n){return o.String(n)||o.Number(n)},t=!0,function(){var i,f,c;c=[];for(i in o)f=o[i],c.push(function(o,i){return n["is"+o]=i,n["not"+o]=function(n){return!i(n)},n["has"+o]=function(){return u(i,t,arguments)},n["all"+o]=function(){return u(i,!t,arguments)},o in e?n["force"+o]=r(o):void 0}(i,f));return c}(),n["typeof"]=function(n){var t,r;for(r in o)if(t=o[r],t(n)===!0)return r.toLowerCase();return"unknown"},"undefined"!=typeof window&&null!==window?window.Types=n:module&&(module.exports=n)}).call(this); | ||
(function(){"use strict";var n,t,r,e,u,o;n={parseIntBase:10},e={Boolean:!1,String:"",Number:0,Object:{},Array:[],Function:function(){}},r=function(t){var r;return r=function(r){switch(t){case"Number":if(n.notNaN(r=parseInt(r,n.parseIntBase)))return r;break;case"String":if(n.isStringOrNumber(r))return r+"";break;default:if(n["is"+t](r))return r}return!1},function(n,u){return null==u&&(u=n),!1!==(n=r(n))?n:!1!==(u=r(u))?u:e[t]}},u=function(n,t,r){var e,u,i;if(null==r&&(r=[]),r.length<1)return n===o.Undefined?!0:!1;for(u=0,i=r.length;i>u;u++)if(e=r[u],n(e)===t)return t;return!t},o={Undefined:function(n){return void 0===n},Null:function(n){return null===n},Boolean:function(n){return"boolean"==typeof n},String:function(n){return"string"==typeof n},Function:function(n){return"function"==typeof n},Number:function(n){return"number"==typeof n&&n===n},Array:function(n){return"object"==typeof n&&n instanceof Array},RegExp:function(n){return"object"==typeof n&&n instanceof RegExp},Date:function(n){return"object"==typeof n&&n instanceof Date},Object:function(n){return!("object"!=typeof n||n instanceof Array||n instanceof RegExp||n instanceof Date||null===n)},NaN:function(n){return"number"==typeof n&&n!==n}},o.StringOrNumber=function(n){return o.String(n)||o.Number(n)},t=!0,function(){var i,f,c;c=[];for(i in o)f=o[i],c.push(function(o,i){return n["is"+o]=i,n["not"+o]=function(n){return!i(n)},n["has"+o]=function(){return u(i,t,arguments)},n["all"+o]=function(){return u(i,!t,arguments)},o in e?n["force"+o]=r(o):void 0}(i,f));return c}(),n["typeof"]=function(n){var t,r;for(r in o)if(t=o[r],t(n)===!0)return r.toLowerCase();return"unknown"},"undefined"!=typeof window&&null!==window?window.Types=n:module&&(module.exports=n)}).call(this); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
140873
1914