(obj)
| 236 | } |
| 237 | |
| 238 | function objectType(obj) { |
| 239 | if (typeof obj === "undefined") { |
| 240 | return "undefined"; |
| 241 | } |
| 242 | |
| 243 | // Consider: typeof null === object |
| 244 | if (obj === null) { |
| 245 | return "null"; |
| 246 | } |
| 247 | |
| 248 | var match = toString.call(obj).match(/^\[object\s(.*)\]$/), |
| 249 | type = match && match[1]; |
| 250 | |
| 251 | switch (type) { |
| 252 | case "Number": |
| 253 | if (isNaN(obj)) { |
| 254 | return "nan"; |
| 255 | } |
| 256 | return "number"; |
| 257 | case "String": |
| 258 | case "Boolean": |
| 259 | case "Array": |
| 260 | case "Set": |
| 261 | case "Map": |
| 262 | case "Date": |
| 263 | case "RegExp": |
| 264 | case "Function": |
| 265 | case "Symbol": |
| 266 | return type.toLowerCase(); |
| 267 | default: |
| 268 | return typeof obj === "undefined" ? "undefined" : _typeof(obj); |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | // Safe object type checking |
| 273 | function is(type, obj) { |
no outgoing calls
no test coverage detected