UNPKG

506 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = objType;
7
8function objType(obj) {
9 var type = Object.prototype.toString.call(obj).slice(8, -1);
10
11 if (type === 'Object' && typeof obj[Symbol.iterator] === 'function') {
12 return 'Iterable';
13 }
14
15 if (type === 'Custom' && obj.constructor !== Object && obj instanceof Object) {
16 // For projects implementing objects overriding `.prototype[Symbol.toStringTag]`
17 return 'Object';
18 }
19
20 return type;
21}
\No newline at end of file