@@ -95,7 +95,7 @@ module.exports = function typeDetect(obj) {
95
95
* array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled)
96
96
*/
97
97
if ( isArrayExists && Array . isArray ( obj ) ) {
98
- return 'array ' ;
98
+ return 'Array ' ;
99
99
}
100
100
101
101
if ( isDom ) {
@@ -107,7 +107,7 @@ module.exports = function typeDetect(obj) {
107
107
* - IE Edge <=13 === "[object Object]"
108
108
*/
109
109
if ( obj === globalObject . location ) {
110
- return 'location ' ;
110
+ return 'Location ' ;
111
111
}
112
112
113
113
/* ! Spec Conformance
@@ -130,7 +130,7 @@ module.exports = function typeDetect(obj) {
130
130
* - IE Edge <=13 === "[object HTMLDocument]"
131
131
*/
132
132
if ( obj === globalObject . document ) {
133
- return 'document ' ;
133
+ return 'Document ' ;
134
134
}
135
135
136
136
/* ! Spec Conformance
@@ -140,7 +140,7 @@ module.exports = function typeDetect(obj) {
140
140
* - IE <=10 === "[object MSMimeTypesCollection]"
141
141
*/
142
142
if ( obj === ( globalObject . navigator || { } ) . mimeTypes ) {
143
- return 'mimetypearray ' ;
143
+ return 'MimeTypeArray ' ;
144
144
}
145
145
146
146
/* ! Spec Conformance
@@ -150,7 +150,7 @@ module.exports = function typeDetect(obj) {
150
150
* - IE <=10 === "[object MSPluginsCollection]"
151
151
*/
152
152
if ( obj === ( globalObject . navigator || { } ) . plugins ) {
153
- return 'pluginarray ' ;
153
+ return 'PluginArray ' ;
154
154
}
155
155
156
156
/* ! Spec Conformance
@@ -160,7 +160,7 @@ module.exports = function typeDetect(obj) {
160
160
* - IE <=10 === "[object HTMLBlockElement]"
161
161
*/
162
162
if ( htmlElementExists && obj instanceof HTMLElement && obj . tagName === 'BLOCKQUOTE' ) {
163
- return 'htmlquoteelement ' ;
163
+ return 'HTMLQuoteElement ' ;
164
164
}
165
165
166
166
/* ! Spec Conformance
@@ -176,7 +176,7 @@ module.exports = function typeDetect(obj) {
176
176
* - Safari === "[object HTMLTableCellElement]"
177
177
*/
178
178
if ( htmlElementExists && obj instanceof HTMLElement && obj . tagName === 'TD' ) {
179
- return 'htmltabledatacellelement ' ;
179
+ return 'HTMLTableDataCellElement ' ;
180
180
}
181
181
182
182
/* ! Spec Conformance
@@ -192,7 +192,7 @@ module.exports = function typeDetect(obj) {
192
192
* - Safari === "[object HTMLTableCellElement]"
193
193
*/
194
194
if ( htmlElementExists && obj instanceof HTMLElement && obj . tagName === 'TH' ) {
195
- return 'htmltableheadercellelement ' ;
195
+ return 'HTMLTableHeaderCellElement ' ;
196
196
}
197
197
}
198
198
@@ -220,7 +220,7 @@ module.exports = function typeDetect(obj) {
220
220
*/
221
221
var stringTag = ( symbolToStringTagExists && obj [ Symbol . toStringTag ] ) ;
222
222
if ( typeof stringTag === 'string' ) {
223
- return stringTag . toLowerCase ( ) ;
223
+ return stringTag ;
224
224
}
225
225
226
226
if ( getPrototypeOfExists ) {
@@ -234,7 +234,7 @@ module.exports = function typeDetect(obj) {
234
234
* regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled)
235
235
*/
236
236
if ( objPrototype === RegExp . prototype ) {
237
- return 'regexp ' ;
237
+ return 'RegExp ' ;
238
238
}
239
239
240
240
/* ! Speed optimisation
@@ -244,7 +244,7 @@ module.exports = function typeDetect(obj) {
244
244
* date x 3,953,779 ops/sec ±1.35% (77 runs sampled)
245
245
*/
246
246
if ( objPrototype === Date . prototype ) {
247
- return 'date ' ;
247
+ return 'Date ' ;
248
248
}
249
249
250
250
/* ! Spec Conformance
@@ -257,7 +257,7 @@ module.exports = function typeDetect(obj) {
257
257
* - Safari 7.1-Latest === "[object Promise]"
258
258
*/
259
259
if ( promiseExists && objPrototype === Promise . prototype ) {
260
- return 'promise ' ;
260
+ return 'Promise ' ;
261
261
}
262
262
263
263
/* ! Speed optimisation
@@ -267,7 +267,7 @@ module.exports = function typeDetect(obj) {
267
267
* set x 4,545,879 ops/sec ±1.13% (83 runs sampled)
268
268
*/
269
269
if ( setExists && objPrototype === Set . prototype ) {
270
- return 'set ' ;
270
+ return 'Set ' ;
271
271
}
272
272
273
273
/* ! Speed optimisation
@@ -277,7 +277,7 @@ module.exports = function typeDetect(obj) {
277
277
* map x 4,183,945 ops/sec ±6.59% (82 runs sampled)
278
278
*/
279
279
if ( mapExists && objPrototype === Map . prototype ) {
280
- return 'map ' ;
280
+ return 'Map ' ;
281
281
}
282
282
283
283
/* ! Speed optimisation
@@ -287,7 +287,7 @@ module.exports = function typeDetect(obj) {
287
287
* weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled)
288
288
*/
289
289
if ( weakSetExists && objPrototype === WeakSet . prototype ) {
290
- return 'weakset ' ;
290
+ return 'WeakSet ' ;
291
291
}
292
292
293
293
/* ! Speed optimisation
@@ -297,7 +297,7 @@ module.exports = function typeDetect(obj) {
297
297
* weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled)
298
298
*/
299
299
if ( weakMapExists && objPrototype === WeakMap . prototype ) {
300
- return 'weakmap ' ;
300
+ return 'WeakMap ' ;
301
301
}
302
302
303
303
/* ! Spec Conformance
@@ -307,7 +307,7 @@ module.exports = function typeDetect(obj) {
307
307
* - Edge <=13 === "[object Object]"
308
308
*/
309
309
if ( dataViewExists && objPrototype === DataView . prototype ) {
310
- return 'dataview ' ;
310
+ return 'DataView ' ;
311
311
}
312
312
313
313
/* ! Spec Conformance
@@ -317,7 +317,7 @@ module.exports = function typeDetect(obj) {
317
317
* - Edge <=13 === "[object Object]"
318
318
*/
319
319
if ( mapExists && objPrototype === mapIteratorPrototype ) {
320
- return 'map iterator ' ;
320
+ return 'Map Iterator ' ;
321
321
}
322
322
323
323
/* ! Spec Conformance
@@ -327,7 +327,7 @@ module.exports = function typeDetect(obj) {
327
327
* - Edge <=13 === "[object Object]"
328
328
*/
329
329
if ( setExists && objPrototype === setIteratorPrototype ) {
330
- return 'set iterator ' ;
330
+ return 'Set Iterator ' ;
331
331
}
332
332
333
333
/* ! Spec Conformance
@@ -337,7 +337,7 @@ module.exports = function typeDetect(obj) {
337
337
* - Edge <=13 === "[object Object]"
338
338
*/
339
339
if ( arrayIteratorExists && objPrototype === arrayIteratorPrototype ) {
340
- return 'array iterator ' ;
340
+ return 'Array Iterator ' ;
341
341
}
342
342
343
343
/* ! Spec Conformance
@@ -347,7 +347,7 @@ module.exports = function typeDetect(obj) {
347
347
* - Edge <=13 === "[object Object]"
348
348
*/
349
349
if ( stringIteratorExists && objPrototype === stringIteratorPrototype ) {
350
- return 'string iterator ' ;
350
+ return 'String Iterator ' ;
351
351
}
352
352
353
353
/* ! Speed optimisation
@@ -357,16 +357,15 @@ module.exports = function typeDetect(obj) {
357
357
* object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled)
358
358
*/
359
359
if ( objPrototype === null ) {
360
- return 'object ' ;
360
+ return 'Object ' ;
361
361
}
362
362
}
363
363
364
364
return Object
365
365
. prototype
366
366
. toString
367
367
. call ( obj )
368
- . slice ( toStringLeftSliceLength , toStringRightSliceLength )
369
- . toLowerCase ( ) ;
368
+ . slice ( toStringLeftSliceLength , toStringRightSliceLength ) ;
370
369
} ;
371
370
372
371
module . exports . typeDetect = module . exports ;
0 commit comments