type-detect
Advanced tools
Comparing version 0.1.1 to 0.1.2
0.1.2 / 2013-11-30 | ||
================== | ||
* Library: constructor with new | ||
0.1.1 / 2013-10-10 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -37,3 +37,3 @@ /*! | ||
function getType (obj) { | ||
function getType(obj) { | ||
var str = Object.prototype.toString.call(obj); | ||
@@ -60,3 +60,4 @@ if (natives[str]) return natives[str]; | ||
function Library () { | ||
function Library() { | ||
if (!(this instanceof Library)) return new Library(); | ||
this.tests = {}; | ||
@@ -109,3 +110,3 @@ } | ||
Library.prototype.define = function (type, test) { | ||
Library.prototype.define = function(type, test) { | ||
if (arguments.length === 1) return this.tests[type]; | ||
@@ -134,3 +135,3 @@ this.tests[type] = test; | ||
Library.prototype.test = function (obj, type) { | ||
Library.prototype.test = function(obj, type) { | ||
if (type === getType(obj)) return true; | ||
@@ -137,0 +138,0 @@ var test = this.tests[type]; |
{ | ||
"name": "type-detect" | ||
, "version": "0.1.1" | ||
, "version": "0.1.2" | ||
, "description": "Improved typeof detection for node.js and the browser." | ||
@@ -5,0 +5,0 @@ , "author": "Jake Luer <jake@alogicalparadox.com> (http://alogicalparadox.com)" |
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
8447
128