fixed bug when Array.prototype is extended
This commit is contained in:
parent
85e8e0d5ac
commit
9e65aafde1
|
@ -8,9 +8,11 @@
|
||||||
class2type = {};
|
class2type = {};
|
||||||
|
|
||||||
for (i in classes) {
|
for (i in classes) {
|
||||||
|
if (classes.hasOwnProperty(i)) {
|
||||||
name = classes[i];
|
name = classes[i];
|
||||||
class2type["[object " + name + "]"] = name.toLowerCase();
|
class2type["[object " + name + "]"] = name.toLowerCase();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function typeOf(obj) {
|
function typeOf(obj) {
|
||||||
return (null === obj || undefined === obj) ? String(obj) : class2type[Object.prototype.toString.call(obj)] || "object";
|
return (null === obj || undefined === obj) ? String(obj) : class2type[Object.prototype.toString.call(obj)] || "object";
|
||||||
|
|
12
package.json
12
package.json
|
@ -1,12 +0,0 @@
|
||||||
{
|
|
||||||
"name" : "remedial",
|
|
||||||
"description" : "Douglas Crockford's Remedial JavaScript",
|
|
||||||
"url" : "http://javascript.crockford.com/remedial.html",
|
|
||||||
"keywords" : ["util", "isEmpty", "typeOf", "entityify", "quote", "supplant", "trim"],
|
|
||||||
"author" : "Douglas Crockford <douglas@crockford.com>",
|
|
||||||
"contributors" : [],
|
|
||||||
"dependencies" : [],
|
|
||||||
"lib" : "lib",
|
|
||||||
"main" : "./lib/remedial",
|
|
||||||
"version" : "1.0.4"
|
|
||||||
}
|
|
Loading…
Reference in New Issue