Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use `.valueOf` instead of partial `.toString`

  • Loading branch information...
commit 7aa284b190779c9dc950f1d955b3c39c0c3ae003 1 parent 6e0318e
@yorkie yorkie authored yorkie committed
Showing with 2 additions and 5 deletions.
  1. +2 −5 index.js
View
7 index.js
@@ -1,4 +1,3 @@
-
/**
* toString ref.
*/
@@ -20,13 +19,11 @@ module.exports = function(val){
case '[object RegExp]': return 'regexp';
case '[object Arguments]': return 'arguments';
case '[object Array]': return 'array';
- case '[object String]': return 'string';
}
if (val === null) return 'null';
if (val === undefined) return 'undefined';
if (val && val.nodeType === 1) return 'element';
- if (val === Object(val)) return 'object';
-
- return typeof val;
+
+ return typeof val.valueOf();
};
Please sign in to comment.
Something went wrong with that request. Please try again.