Comparing version 1.4.31 to 1.4.42
{ | ||
"name": "types.js", | ||
"version": "1.4.31", | ||
"description": "A tiny (1.8kb), essential Javascript type-check library", | ||
"version": "1.4.42", | ||
"description": "A tiny (1.9kb), essential Javascript type-check library", | ||
"main": "types.min.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
types.js | ||
======== | ||
<br/> | ||
A tiny(1.8Kb), essential Javascript type checking library. | ||
A tiny(1.9Kb), essential Javascript type checking library. | ||
@@ -55,3 +55,19 @@ - fixes NaN, array, null, etc.. | ||
___ | ||
**node.js** | ||
For use with node.js you can install with `npm install types.js` | ||
**AMD** | ||
When using AMD, you can load types.js like so: | ||
```javascript | ||
require.config({ | ||
paths: { | ||
'types', [ 'path/to/types.min' ] | ||
} | ||
}); | ||
require( ['types'], function( Types ){ | ||
console.log( Types.isNumber(0) ); | ||
// true | ||
}); | ||
``` | ||
___ | ||
@@ -354,3 +370,6 @@ | ||
========== | ||
**1.4.4** | ||
Added AMD support. | ||
___ | ||
**1.4.2** | ||
@@ -370,3 +389,3 @@ | ||
__________________________________________ | ||
___ | ||
**1.3.5** | ||
@@ -373,0 +392,0 @@ |
@@ -162,3 +162,7 @@ // Generated by CoffeeScript 1.8.0 | ||
if (typeof window !== 'undefined') { | ||
if ((typeof define !== "undefined" && define !== null) && ('function' === typeof define) && define.amd) { | ||
define('types', [], function() { | ||
return Types; | ||
}); | ||
} else if (typeof window !== 'undefined') { | ||
window.Types = Types; | ||
@@ -165,0 +169,0 @@ } else if (typeof module !== 'undefined') { |
@@ -1,1 +0,1 @@ | ||
(function(){"use strict";var n,r,t,e,u,i,o,f,c;i=function(n,r){return r instanceof n},f=function(n,r){return null==r&&(r="object"),typeof n===r},n={Boolean:!1,String:"",Object:{},Array:[],Function:function(){},Number:function(){var n;return n=new Number,n["void"]=!0,n}()},r={Undefined:function(n){return void 0===n},Null:function(n){return null===n},Function:function(n){return f(n,"function")},Boolean:function(n){return f(n,"boolean")},String:function(n){return f(n,"string")},Array:function(n){return f(n)&&i(Array,n)},RegExp:function(n){return f(n)&&i(RegExp,n)},Date:function(n){return f(n)&&i(Date,n)},Number:function(n){return f(n,"number")&&n===n||f(n)&&i(Number,n)},Object:function(n){return!(!f(n)||null===n||i(Boolean,n)||i(Number,n)||i(Array,n)||i(RegExp,n)||i(Date,n))},NaN:function(n){return f(n,"number")&&n!==n},Defined:function(n){return void 0!==n}},r.StringOrNumber=function(n){return r.String(n)||r.Number(n)},t=c={parseIntBase:10},u=function(r){var e;return e=function(n){switch(r){case"Number":if(c.isNumber(n=parseInt(n,c.parseIntBase))&&!n["void"])return n;break;case"String":if(c.isStringOrNumber(n))return n+"";break;default:if(t["is"+r](n))return n}},function(t,u){return null!=t&&void 0!==(t=e(t))?t:null!=u&&void 0!==(u=e(u))?u:n[r]}},o=function(n,t,e){var u,i,o;if(null==e&&(e=[]),e.length<1)return n===r.Undefined;for(i=0,o=e.length;o>i;i++)if(u=e[i],n(u)===t)return t;return!t},e=!0,function(){var i,f,c;c=[];for(i in r)f=r[i],c.push(function(r,i){return t["is"+r]=i,t["not"+r]=function(n){return!i(n)},t["has"+r]=function(){return o(i,e,arguments)},t["all"+r]=function(){return o(i,!e,arguments)},r in n?t["force"+r]=u(r):void 0}(i,f));return c}(),t["typeof"]=function(n){var t,e;for(t in r)if(e=r[t],e(n)===!0)return t.toLowerCase()},"undefined"!=typeof window?window.Types=t:"undefined"!=typeof module&&(module.exports=t)}).call(this); | ||
(function(){"use strict";var n,r,e,t,u,i,o,f,c;i=function(n,r){return r instanceof n},f=function(n,r){return null==r&&(r="object"),typeof n===r},n={Boolean:!1,String:"",Object:{},Array:[],Function:function(){},Number:function(){var n;return n=new Number,n["void"]=!0,n}()},r={Undefined:function(n){return void 0===n},Null:function(n){return null===n},Function:function(n){return f(n,"function")},Boolean:function(n){return f(n,"boolean")},String:function(n){return f(n,"string")},Array:function(n){return f(n)&&i(Array,n)},RegExp:function(n){return f(n)&&i(RegExp,n)},Date:function(n){return f(n)&&i(Date,n)},Number:function(n){return f(n,"number")&&n===n||f(n)&&i(Number,n)},Object:function(n){return!(!f(n)||null===n||i(Boolean,n)||i(Number,n)||i(Array,n)||i(RegExp,n)||i(Date,n))},NaN:function(n){return f(n,"number")&&n!==n},Defined:function(n){return void 0!==n}},r.StringOrNumber=function(n){return r.String(n)||r.Number(n)},e=c={parseIntBase:10},u=function(r){var t;return t=function(n){switch(r){case"Number":if(c.isNumber(n=parseInt(n,c.parseIntBase))&&!n["void"])return n;break;case"String":if(c.isStringOrNumber(n))return n+"";break;default:if(e["is"+r](n))return n}},function(e,u){return null!=e&&void 0!==(e=t(e))?e:null!=u&&void 0!==(u=t(u))?u:n[r]}},o=function(n,e,t){var u,i,o;if(null==t&&(t=[]),t.length<1)return n===r.Undefined;for(i=0,o=t.length;o>i;i++)if(u=t[i],n(u)===e)return e;return!e},t=!0,function(){var i,f,c;c=[];for(i in r)f=r[i],c.push(function(r,i){return e["is"+r]=i,e["not"+r]=function(n){return!i(n)},e["has"+r]=function(){return o(i,t,arguments)},e["all"+r]=function(){return o(i,!t,arguments)},r in n?e["force"+r]=u(r):void 0}(i,f));return c}(),e["typeof"]=function(n){var e,t;for(e in r)if(t=r[e],t(n)===!0)return e.toLowerCase()},"undefined"!=typeof define&&null!==define&&"function"==typeof define&&define.amd?define("types",[],function(){return e}):"undefined"!=typeof window?window.Types=e:"undefined"!=typeof module&&(module.exports=e)}).call(this); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
152707
2026
434