chai 4.4.1 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chai.js +135 -384
- package/package.json +2 -2
package/chai.js
CHANGED
|
@@ -11157,393 +11157,144 @@ module.exports = {
|
|
|
11157
11157
|
|
|
11158
11158
|
},{}],39:[function(require,module,exports){
|
|
11159
11159
|
(function (global, factory) {
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
}(this, (function () { 'use strict';
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
var
|
|
11177
|
-
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
var
|
|
11181
|
-
var
|
|
11182
|
-
var
|
|
11183
|
-
var
|
|
11184
|
-
var
|
|
11185
|
-
var
|
|
11186
|
-
var
|
|
11187
|
-
var
|
|
11188
|
-
var
|
|
11189
|
-
var
|
|
11190
|
-
var
|
|
11191
|
-
var
|
|
11192
|
-
var
|
|
11193
|
-
|
|
11194
|
-
|
|
11195
|
-
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
|
|
11199
|
-
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11286
|
-
|
|
11287
|
-
|
|
11288
|
-
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11293
|
-
* - Firefox === "[object HTMLDocument]"
|
|
11294
|
-
* - Safari === "[object HTMLDocument]"
|
|
11295
|
-
* - IE <=10 === "[object Document]"
|
|
11296
|
-
* - IE 11 === "[object HTMLDocument]"
|
|
11297
|
-
* - IE Edge <=13 === "[object HTMLDocument]"
|
|
11298
|
-
*/
|
|
11299
|
-
if (typeof window.document === 'object' && obj === window.document) {
|
|
11300
|
-
return 'Document';
|
|
11301
|
-
}
|
|
11302
|
-
|
|
11303
|
-
if (typeof window.navigator === 'object') {
|
|
11304
|
-
/* ! Spec Conformance
|
|
11305
|
-
* (https://html.spec.whatwg.org/multipage/webappapis.html#mimetypearray)
|
|
11306
|
-
* WhatWG HTML$8.6.1.5 - Plugins - Interface MimeTypeArray
|
|
11307
|
-
* Test: `Object.prototype.toString.call(navigator.mimeTypes)``
|
|
11308
|
-
* - IE <=10 === "[object MSMimeTypesCollection]"
|
|
11309
|
-
*/
|
|
11310
|
-
if (typeof window.navigator.mimeTypes === 'object' &&
|
|
11311
|
-
obj === window.navigator.mimeTypes) {
|
|
11312
|
-
return 'MimeTypeArray';
|
|
11313
|
-
}
|
|
11314
|
-
|
|
11315
|
-
/* ! Spec Conformance
|
|
11316
|
-
* (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray)
|
|
11317
|
-
* WhatWG HTML$8.6.1.5 - Plugins - Interface PluginArray
|
|
11318
|
-
* Test: `Object.prototype.toString.call(navigator.plugins)``
|
|
11319
|
-
* - IE <=10 === "[object MSPluginsCollection]"
|
|
11320
|
-
*/
|
|
11321
|
-
if (typeof window.navigator.plugins === 'object' &&
|
|
11322
|
-
obj === window.navigator.plugins) {
|
|
11323
|
-
return 'PluginArray';
|
|
11324
|
-
}
|
|
11325
|
-
}
|
|
11326
|
-
|
|
11327
|
-
if ((typeof window.HTMLElement === 'function' ||
|
|
11328
|
-
typeof window.HTMLElement === 'object') &&
|
|
11329
|
-
obj instanceof window.HTMLElement) {
|
|
11330
|
-
/* ! Spec Conformance
|
|
11331
|
-
* (https://html.spec.whatwg.org/multipage/webappapis.html#pluginarray)
|
|
11332
|
-
* WhatWG HTML$4.4.4 - The `blockquote` element - Interface `HTMLQuoteElement`
|
|
11333
|
-
* Test: `Object.prototype.toString.call(document.createElement('blockquote'))``
|
|
11334
|
-
* - IE <=10 === "[object HTMLBlockElement]"
|
|
11335
|
-
*/
|
|
11336
|
-
if (obj.tagName === 'BLOCKQUOTE') {
|
|
11337
|
-
return 'HTMLQuoteElement';
|
|
11338
|
-
}
|
|
11339
|
-
|
|
11340
|
-
/* ! Spec Conformance
|
|
11341
|
-
* (https://html.spec.whatwg.org/#htmltabledatacellelement)
|
|
11342
|
-
* WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableDataCellElement`
|
|
11343
|
-
* Note: Most browsers currently adher to the W3C DOM Level 2 spec
|
|
11344
|
-
* (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075)
|
|
11345
|
-
* which suggests that browsers should use HTMLTableCellElement for
|
|
11346
|
-
* both TD and TH elements. WhatWG separates these.
|
|
11347
|
-
* Test: Object.prototype.toString.call(document.createElement('td'))
|
|
11348
|
-
* - Chrome === "[object HTMLTableCellElement]"
|
|
11349
|
-
* - Firefox === "[object HTMLTableCellElement]"
|
|
11350
|
-
* - Safari === "[object HTMLTableCellElement]"
|
|
11351
|
-
*/
|
|
11352
|
-
if (obj.tagName === 'TD') {
|
|
11353
|
-
return 'HTMLTableDataCellElement';
|
|
11354
|
-
}
|
|
11355
|
-
|
|
11356
|
-
/* ! Spec Conformance
|
|
11357
|
-
* (https://html.spec.whatwg.org/#htmltableheadercellelement)
|
|
11358
|
-
* WhatWG HTML$4.9.9 - The `td` element - Interface `HTMLTableHeaderCellElement`
|
|
11359
|
-
* Note: Most browsers currently adher to the W3C DOM Level 2 spec
|
|
11360
|
-
* (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-82915075)
|
|
11361
|
-
* which suggests that browsers should use HTMLTableCellElement for
|
|
11362
|
-
* both TD and TH elements. WhatWG separates these.
|
|
11363
|
-
* Test: Object.prototype.toString.call(document.createElement('th'))
|
|
11364
|
-
* - Chrome === "[object HTMLTableCellElement]"
|
|
11365
|
-
* - Firefox === "[object HTMLTableCellElement]"
|
|
11366
|
-
* - Safari === "[object HTMLTableCellElement]"
|
|
11367
|
-
*/
|
|
11368
|
-
if (obj.tagName === 'TH') {
|
|
11369
|
-
return 'HTMLTableHeaderCellElement';
|
|
11370
|
-
}
|
|
11160
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
11161
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
|
11162
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.typeDetect = factory());
|
|
11163
|
+
})(this, (function () { 'use strict';
|
|
11164
|
+
|
|
11165
|
+
var promiseExists = typeof Promise === 'function';
|
|
11166
|
+
var globalObject = (function (Obj) {
|
|
11167
|
+
if (typeof globalThis === 'object') {
|
|
11168
|
+
return globalThis;
|
|
11169
|
+
}
|
|
11170
|
+
Object.defineProperty(Obj, 'typeDetectGlobalObject', {
|
|
11171
|
+
get: function get() {
|
|
11172
|
+
return this;
|
|
11173
|
+
},
|
|
11174
|
+
configurable: true,
|
|
11175
|
+
});
|
|
11176
|
+
var global = typeDetectGlobalObject;
|
|
11177
|
+
delete Obj.typeDetectGlobalObject;
|
|
11178
|
+
return global;
|
|
11179
|
+
})(Object.prototype);
|
|
11180
|
+
var symbolExists = typeof Symbol !== 'undefined';
|
|
11181
|
+
var mapExists = typeof Map !== 'undefined';
|
|
11182
|
+
var setExists = typeof Set !== 'undefined';
|
|
11183
|
+
var weakMapExists = typeof WeakMap !== 'undefined';
|
|
11184
|
+
var weakSetExists = typeof WeakSet !== 'undefined';
|
|
11185
|
+
var dataViewExists = typeof DataView !== 'undefined';
|
|
11186
|
+
var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined';
|
|
11187
|
+
var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined';
|
|
11188
|
+
var setEntriesExists = setExists && typeof Set.prototype.entries === 'function';
|
|
11189
|
+
var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function';
|
|
11190
|
+
var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries());
|
|
11191
|
+
var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries());
|
|
11192
|
+
var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function';
|
|
11193
|
+
var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]());
|
|
11194
|
+
var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function';
|
|
11195
|
+
var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]());
|
|
11196
|
+
var toStringLeftSliceLength = 8;
|
|
11197
|
+
var toStringRightSliceLength = -1;
|
|
11198
|
+
function typeDetect(obj) {
|
|
11199
|
+
var typeofObj = typeof obj;
|
|
11200
|
+
if (typeofObj !== 'object') {
|
|
11201
|
+
return typeofObj;
|
|
11202
|
+
}
|
|
11203
|
+
if (obj === null) {
|
|
11204
|
+
return 'null';
|
|
11205
|
+
}
|
|
11206
|
+
if (obj === globalObject) {
|
|
11207
|
+
return 'global';
|
|
11208
|
+
}
|
|
11209
|
+
if (Array.isArray(obj) &&
|
|
11210
|
+
(symbolToStringTagExists === false || !(Symbol.toStringTag in obj))) {
|
|
11211
|
+
return 'Array';
|
|
11212
|
+
}
|
|
11213
|
+
if (typeof window === 'object' && window !== null) {
|
|
11214
|
+
if (typeof window.location === 'object' && obj === window.location) {
|
|
11215
|
+
return 'Location';
|
|
11216
|
+
}
|
|
11217
|
+
if (typeof window.document === 'object' && obj === window.document) {
|
|
11218
|
+
return 'Document';
|
|
11219
|
+
}
|
|
11220
|
+
if (typeof window.navigator === 'object') {
|
|
11221
|
+
if (typeof window.navigator.mimeTypes === 'object' &&
|
|
11222
|
+
obj === window.navigator.mimeTypes) {
|
|
11223
|
+
return 'MimeTypeArray';
|
|
11224
|
+
}
|
|
11225
|
+
if (typeof window.navigator.plugins === 'object' &&
|
|
11226
|
+
obj === window.navigator.plugins) {
|
|
11227
|
+
return 'PluginArray';
|
|
11228
|
+
}
|
|
11229
|
+
}
|
|
11230
|
+
if ((typeof window.HTMLElement === 'function' ||
|
|
11231
|
+
typeof window.HTMLElement === 'object') &&
|
|
11232
|
+
obj instanceof window.HTMLElement) {
|
|
11233
|
+
if (obj.tagName === 'BLOCKQUOTE') {
|
|
11234
|
+
return 'HTMLQuoteElement';
|
|
11235
|
+
}
|
|
11236
|
+
if (obj.tagName === 'TD') {
|
|
11237
|
+
return 'HTMLTableDataCellElement';
|
|
11238
|
+
}
|
|
11239
|
+
if (obj.tagName === 'TH') {
|
|
11240
|
+
return 'HTMLTableHeaderCellElement';
|
|
11241
|
+
}
|
|
11242
|
+
}
|
|
11243
|
+
}
|
|
11244
|
+
var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]);
|
|
11245
|
+
if (typeof stringTag === 'string') {
|
|
11246
|
+
return stringTag;
|
|
11247
|
+
}
|
|
11248
|
+
var objPrototype = Object.getPrototypeOf(obj);
|
|
11249
|
+
if (objPrototype === RegExp.prototype) {
|
|
11250
|
+
return 'RegExp';
|
|
11251
|
+
}
|
|
11252
|
+
if (objPrototype === Date.prototype) {
|
|
11253
|
+
return 'Date';
|
|
11254
|
+
}
|
|
11255
|
+
if (promiseExists && objPrototype === Promise.prototype) {
|
|
11256
|
+
return 'Promise';
|
|
11257
|
+
}
|
|
11258
|
+
if (setExists && objPrototype === Set.prototype) {
|
|
11259
|
+
return 'Set';
|
|
11260
|
+
}
|
|
11261
|
+
if (mapExists && objPrototype === Map.prototype) {
|
|
11262
|
+
return 'Map';
|
|
11263
|
+
}
|
|
11264
|
+
if (weakSetExists && objPrototype === WeakSet.prototype) {
|
|
11265
|
+
return 'WeakSet';
|
|
11266
|
+
}
|
|
11267
|
+
if (weakMapExists && objPrototype === WeakMap.prototype) {
|
|
11268
|
+
return 'WeakMap';
|
|
11269
|
+
}
|
|
11270
|
+
if (dataViewExists && objPrototype === DataView.prototype) {
|
|
11271
|
+
return 'DataView';
|
|
11272
|
+
}
|
|
11273
|
+
if (mapExists && objPrototype === mapIteratorPrototype) {
|
|
11274
|
+
return 'Map Iterator';
|
|
11275
|
+
}
|
|
11276
|
+
if (setExists && objPrototype === setIteratorPrototype) {
|
|
11277
|
+
return 'Set Iterator';
|
|
11278
|
+
}
|
|
11279
|
+
if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) {
|
|
11280
|
+
return 'Array Iterator';
|
|
11281
|
+
}
|
|
11282
|
+
if (stringIteratorExists && objPrototype === stringIteratorPrototype) {
|
|
11283
|
+
return 'String Iterator';
|
|
11284
|
+
}
|
|
11285
|
+
if (objPrototype === null) {
|
|
11286
|
+
return 'Object';
|
|
11287
|
+
}
|
|
11288
|
+
return Object
|
|
11289
|
+
.prototype
|
|
11290
|
+
.toString
|
|
11291
|
+
.call(obj)
|
|
11292
|
+
.slice(toStringLeftSliceLength, toStringRightSliceLength);
|
|
11371
11293
|
}
|
|
11372
|
-
}
|
|
11373
11294
|
|
|
11374
|
-
|
|
11375
|
-
* Pre:
|
|
11376
|
-
* Float64Array x 625,644 ops/sec ±1.58% (80 runs sampled)
|
|
11377
|
-
* Float32Array x 1,279,852 ops/sec ±2.91% (77 runs sampled)
|
|
11378
|
-
* Uint32Array x 1,178,185 ops/sec ±1.95% (83 runs sampled)
|
|
11379
|
-
* Uint16Array x 1,008,380 ops/sec ±2.25% (80 runs sampled)
|
|
11380
|
-
* Uint8Array x 1,128,040 ops/sec ±2.11% (81 runs sampled)
|
|
11381
|
-
* Int32Array x 1,170,119 ops/sec ±2.88% (80 runs sampled)
|
|
11382
|
-
* Int16Array x 1,176,348 ops/sec ±5.79% (86 runs sampled)
|
|
11383
|
-
* Int8Array x 1,058,707 ops/sec ±4.94% (77 runs sampled)
|
|
11384
|
-
* Uint8ClampedArray x 1,110,633 ops/sec ±4.20% (80 runs sampled)
|
|
11385
|
-
* Post:
|
|
11386
|
-
* Float64Array x 7,105,671 ops/sec ±13.47% (64 runs sampled)
|
|
11387
|
-
* Float32Array x 5,887,912 ops/sec ±1.46% (82 runs sampled)
|
|
11388
|
-
* Uint32Array x 6,491,661 ops/sec ±1.76% (79 runs sampled)
|
|
11389
|
-
* Uint16Array x 6,559,795 ops/sec ±1.67% (82 runs sampled)
|
|
11390
|
-
* Uint8Array x 6,463,966 ops/sec ±1.43% (85 runs sampled)
|
|
11391
|
-
* Int32Array x 5,641,841 ops/sec ±3.49% (81 runs sampled)
|
|
11392
|
-
* Int16Array x 6,583,511 ops/sec ±1.98% (80 runs sampled)
|
|
11393
|
-
* Int8Array x 6,606,078 ops/sec ±1.74% (81 runs sampled)
|
|
11394
|
-
* Uint8ClampedArray x 6,602,224 ops/sec ±1.77% (83 runs sampled)
|
|
11395
|
-
*/
|
|
11396
|
-
var stringTag = (symbolToStringTagExists && obj[Symbol.toStringTag]);
|
|
11397
|
-
if (typeof stringTag === 'string') {
|
|
11398
|
-
return stringTag;
|
|
11399
|
-
}
|
|
11400
|
-
|
|
11401
|
-
var objPrototype = Object.getPrototypeOf(obj);
|
|
11402
|
-
/* ! Speed optimisation
|
|
11403
|
-
* Pre:
|
|
11404
|
-
* regex literal x 1,772,385 ops/sec ±1.85% (77 runs sampled)
|
|
11405
|
-
* regex constructor x 2,143,634 ops/sec ±2.46% (78 runs sampled)
|
|
11406
|
-
* Post:
|
|
11407
|
-
* regex literal x 3,928,009 ops/sec ±0.65% (78 runs sampled)
|
|
11408
|
-
* regex constructor x 3,931,108 ops/sec ±0.58% (84 runs sampled)
|
|
11409
|
-
*/
|
|
11410
|
-
if (objPrototype === RegExp.prototype) {
|
|
11411
|
-
return 'RegExp';
|
|
11412
|
-
}
|
|
11413
|
-
|
|
11414
|
-
/* ! Speed optimisation
|
|
11415
|
-
* Pre:
|
|
11416
|
-
* date x 2,130,074 ops/sec ±4.42% (68 runs sampled)
|
|
11417
|
-
* Post:
|
|
11418
|
-
* date x 3,953,779 ops/sec ±1.35% (77 runs sampled)
|
|
11419
|
-
*/
|
|
11420
|
-
if (objPrototype === Date.prototype) {
|
|
11421
|
-
return 'Date';
|
|
11422
|
-
}
|
|
11423
|
-
|
|
11424
|
-
/* ! Spec Conformance
|
|
11425
|
-
* (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-promise.prototype-@@tostringtag)
|
|
11426
|
-
* ES6$25.4.5.4 - Promise.prototype[@@toStringTag] should be "Promise":
|
|
11427
|
-
* Test: `Object.prototype.toString.call(Promise.resolve())``
|
|
11428
|
-
* - Chrome <=47 === "[object Object]"
|
|
11429
|
-
* - Edge <=20 === "[object Object]"
|
|
11430
|
-
* - Firefox 29-Latest === "[object Promise]"
|
|
11431
|
-
* - Safari 7.1-Latest === "[object Promise]"
|
|
11432
|
-
*/
|
|
11433
|
-
if (promiseExists && objPrototype === Promise.prototype) {
|
|
11434
|
-
return 'Promise';
|
|
11435
|
-
}
|
|
11436
|
-
|
|
11437
|
-
/* ! Speed optimisation
|
|
11438
|
-
* Pre:
|
|
11439
|
-
* set x 2,222,186 ops/sec ±1.31% (82 runs sampled)
|
|
11440
|
-
* Post:
|
|
11441
|
-
* set x 4,545,879 ops/sec ±1.13% (83 runs sampled)
|
|
11442
|
-
*/
|
|
11443
|
-
if (setExists && objPrototype === Set.prototype) {
|
|
11444
|
-
return 'Set';
|
|
11445
|
-
}
|
|
11446
|
-
|
|
11447
|
-
/* ! Speed optimisation
|
|
11448
|
-
* Pre:
|
|
11449
|
-
* map x 2,396,842 ops/sec ±1.59% (81 runs sampled)
|
|
11450
|
-
* Post:
|
|
11451
|
-
* map x 4,183,945 ops/sec ±6.59% (82 runs sampled)
|
|
11452
|
-
*/
|
|
11453
|
-
if (mapExists && objPrototype === Map.prototype) {
|
|
11454
|
-
return 'Map';
|
|
11455
|
-
}
|
|
11456
|
-
|
|
11457
|
-
/* ! Speed optimisation
|
|
11458
|
-
* Pre:
|
|
11459
|
-
* weakset x 1,323,220 ops/sec ±2.17% (76 runs sampled)
|
|
11460
|
-
* Post:
|
|
11461
|
-
* weakset x 4,237,510 ops/sec ±2.01% (77 runs sampled)
|
|
11462
|
-
*/
|
|
11463
|
-
if (weakSetExists && objPrototype === WeakSet.prototype) {
|
|
11464
|
-
return 'WeakSet';
|
|
11465
|
-
}
|
|
11466
|
-
|
|
11467
|
-
/* ! Speed optimisation
|
|
11468
|
-
* Pre:
|
|
11469
|
-
* weakmap x 1,500,260 ops/sec ±2.02% (78 runs sampled)
|
|
11470
|
-
* Post:
|
|
11471
|
-
* weakmap x 3,881,384 ops/sec ±1.45% (82 runs sampled)
|
|
11472
|
-
*/
|
|
11473
|
-
if (weakMapExists && objPrototype === WeakMap.prototype) {
|
|
11474
|
-
return 'WeakMap';
|
|
11475
|
-
}
|
|
11476
|
-
|
|
11477
|
-
/* ! Spec Conformance
|
|
11478
|
-
* (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-dataview.prototype-@@tostringtag)
|
|
11479
|
-
* ES6$24.2.4.21 - DataView.prototype[@@toStringTag] should be "DataView":
|
|
11480
|
-
* Test: `Object.prototype.toString.call(new DataView(new ArrayBuffer(1)))``
|
|
11481
|
-
* - Edge <=13 === "[object Object]"
|
|
11482
|
-
*/
|
|
11483
|
-
if (dataViewExists && objPrototype === DataView.prototype) {
|
|
11484
|
-
return 'DataView';
|
|
11485
|
-
}
|
|
11486
|
-
|
|
11487
|
-
/* ! Spec Conformance
|
|
11488
|
-
* (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%mapiteratorprototype%-@@tostringtag)
|
|
11489
|
-
* ES6$23.1.5.2.2 - %MapIteratorPrototype%[@@toStringTag] should be "Map Iterator":
|
|
11490
|
-
* Test: `Object.prototype.toString.call(new Map().entries())``
|
|
11491
|
-
* - Edge <=13 === "[object Object]"
|
|
11492
|
-
*/
|
|
11493
|
-
if (mapExists && objPrototype === mapIteratorPrototype) {
|
|
11494
|
-
return 'Map Iterator';
|
|
11495
|
-
}
|
|
11496
|
-
|
|
11497
|
-
/* ! Spec Conformance
|
|
11498
|
-
* (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%setiteratorprototype%-@@tostringtag)
|
|
11499
|
-
* ES6$23.2.5.2.2 - %SetIteratorPrototype%[@@toStringTag] should be "Set Iterator":
|
|
11500
|
-
* Test: `Object.prototype.toString.call(new Set().entries())``
|
|
11501
|
-
* - Edge <=13 === "[object Object]"
|
|
11502
|
-
*/
|
|
11503
|
-
if (setExists && objPrototype === setIteratorPrototype) {
|
|
11504
|
-
return 'Set Iterator';
|
|
11505
|
-
}
|
|
11506
|
-
|
|
11507
|
-
/* ! Spec Conformance
|
|
11508
|
-
* (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%arrayiteratorprototype%-@@tostringtag)
|
|
11509
|
-
* ES6$22.1.5.2.2 - %ArrayIteratorPrototype%[@@toStringTag] should be "Array Iterator":
|
|
11510
|
-
* Test: `Object.prototype.toString.call([][Symbol.iterator]())``
|
|
11511
|
-
* - Edge <=13 === "[object Object]"
|
|
11512
|
-
*/
|
|
11513
|
-
if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) {
|
|
11514
|
-
return 'Array Iterator';
|
|
11515
|
-
}
|
|
11516
|
-
|
|
11517
|
-
/* ! Spec Conformance
|
|
11518
|
-
* (http://www.ecma-international.org/ecma-262/6.0/index.html#sec-%stringiteratorprototype%-@@tostringtag)
|
|
11519
|
-
* ES6$21.1.5.2.2 - %StringIteratorPrototype%[@@toStringTag] should be "String Iterator":
|
|
11520
|
-
* Test: `Object.prototype.toString.call(''[Symbol.iterator]())``
|
|
11521
|
-
* - Edge <=13 === "[object Object]"
|
|
11522
|
-
*/
|
|
11523
|
-
if (stringIteratorExists && objPrototype === stringIteratorPrototype) {
|
|
11524
|
-
return 'String Iterator';
|
|
11525
|
-
}
|
|
11526
|
-
|
|
11527
|
-
/* ! Speed optimisation
|
|
11528
|
-
* Pre:
|
|
11529
|
-
* object from null x 2,424,320 ops/sec ±1.67% (76 runs sampled)
|
|
11530
|
-
* Post:
|
|
11531
|
-
* object from null x 5,838,000 ops/sec ±0.99% (84 runs sampled)
|
|
11532
|
-
*/
|
|
11533
|
-
if (objPrototype === null) {
|
|
11534
|
-
return 'Object';
|
|
11535
|
-
}
|
|
11295
|
+
return typeDetect;
|
|
11536
11296
|
|
|
11537
|
-
|
|
11538
|
-
.prototype
|
|
11539
|
-
.toString
|
|
11540
|
-
.call(obj)
|
|
11541
|
-
.slice(toStringLeftSliceLength, toStringRightSliceLength);
|
|
11542
|
-
}
|
|
11543
|
-
|
|
11544
|
-
return typeDetect;
|
|
11545
|
-
|
|
11546
|
-
})));
|
|
11297
|
+
}));
|
|
11547
11298
|
|
|
11548
11299
|
},{}]},{},[1])(1)
|
|
11549
11300
|
});
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"Veselin Todorov <hi@vesln.com>",
|
|
18
18
|
"John Firebaugh <john.firebaugh@gmail.com>"
|
|
19
19
|
],
|
|
20
|
-
"version": "4.
|
|
20
|
+
"version": "4.5.0",
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
23
23
|
"url": "https://github.com/chaijs/chai"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"get-func-name": "^2.0.2",
|
|
47
47
|
"loupe": "^2.3.6",
|
|
48
48
|
"pathval": "^1.1.1",
|
|
49
|
-
"type-detect": "^4.0
|
|
49
|
+
"type-detect": "^4.1.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"browserify": "^16.5.2",
|