Skip to content

Commit 1a36d35

Browse files
author
Kristján Oddsson
authoredJul 25, 2024
Update type detect (#1631)
* update `type-detect` * recompile chai.js
1 parent f4b2fbc commit 1a36d35

File tree

3 files changed

+142
-390
lines changed

3 files changed

+142
-390
lines changed
 

Diff for: ‎chai.js

+136-385
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ module.exports = function (_chai, util) {
164164
flag(this, 'lockSsfi', lockSsfi);
165165
flag(this, 'object', obj);
166166
flag(this, 'message', msg);
167-
flag(this, 'eql', config.deepEqual ?? util.eql);
167+
flag(this, 'eql', config.deepEqual || util.eql);
168168

169169
return util.proxify(this);
170170
}
@@ -11157,393 +11157,144 @@ module.exports = {
1115711157

1115811158
},{}],39:[function(require,module,exports){
1115911159
(function (global, factory) {
11160-
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
11161-
typeof define === 'function' && define.amd ? define(factory) :
11162-
(global.typeDetect = factory());
11163-
}(this, (function () { 'use strict';
11164-
11165-
/* !
11166-
* type-detect
11167-
* Copyright(c) 2013 jake luer <jake@alogicalparadox.com>
11168-
* MIT Licensed
11169-
*/
11170-
var promiseExists = typeof Promise === 'function';
11171-
11172-
/* eslint-disable no-undef */
11173-
var globalObject = typeof self === 'object' ? self : global; // eslint-disable-line id-blacklist
11174-
11175-
var symbolExists = typeof Symbol !== 'undefined';
11176-
var mapExists = typeof Map !== 'undefined';
11177-
var setExists = typeof Set !== 'undefined';
11178-
var weakMapExists = typeof WeakMap !== 'undefined';
11179-
var weakSetExists = typeof WeakSet !== 'undefined';
11180-
var dataViewExists = typeof DataView !== 'undefined';
11181-
var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined';
11182-
var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined';
11183-
var setEntriesExists = setExists && typeof Set.prototype.entries === 'function';
11184-
var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function';
11185-
var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries());
11186-
var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries());
11187-
var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function';
11188-
var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]());
11189-
var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function';
11190-
var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]());
11191-
var toStringLeftSliceLength = 8;
11192-
var toStringRightSliceLength = -1;
11193-
/**
11194-
* ### typeOf (obj)
11195-
*
11196-
* Uses `Object.prototype.toString` to determine the type of an object,
11197-
* normalising behaviour across engine versions & well optimised.
11198-
*
11199-
* @param {Mixed} object
11200-
* @return {String} object type
11201-
* @api public
11202-
*/
11203-
function typeDetect(obj) {
11204-
/* ! Speed optimisation
11205-
* Pre:
11206-
* string literal x 3,039,035 ops/sec ±1.62% (78 runs sampled)
11207-
* boolean literal x 1,424,138 ops/sec ±4.54% (75 runs sampled)
11208-
* number literal x 1,653,153 ops/sec ±1.91% (82 runs sampled)
11209-
* undefined x 9,978,660 ops/sec ±1.92% (75 runs sampled)
11210-
* function x 2,556,769 ops/sec ±1.73% (77 runs sampled)
11211-
* Post:
11212-
* string literal x 38,564,796 ops/sec ±1.15% (79 runs sampled)
11213-
* boolean literal x 31,148,940 ops/sec ±1.10% (79 runs sampled)
11214-
* number literal x 32,679,330 ops/sec ±1.90% (78 runs sampled)
11215-
* undefined x 32,363,368 ops/sec ±1.07% (82 runs sampled)
11216-
* function x 31,296,870 ops/sec ±0.96% (83 runs sampled)
11217-
*/
11218-
var typeofObj = typeof obj;
11219-
if (typeofObj !== 'object') {
11220-
return typeofObj;
11221-
}
11222-
11223-
/* ! Speed optimisation
11224-
* Pre:
11225-
* null x 28,645,765 ops/sec ±1.17% (82 runs sampled)
11226-
* Post:
11227-
* null x 36,428,962 ops/sec ±1.37% (84 runs sampled)
11228-
*/
11229-
if (obj === null) {
11230-
return 'null';
11231-
}
11232-
11233-
/* ! Spec Conformance
11234-
* Test: `Object.prototype.toString.call(window)``
11235-
* - Node === "[object global]"
11236-
* - Chrome === "[object global]"
11237-
* - Firefox === "[object Window]"
11238-
* - PhantomJS === "[object Window]"
11239-
* - Safari === "[object Window]"
11240-
* - IE 11 === "[object Window]"
11241-
* - IE Edge === "[object Window]"
11242-
* Test: `Object.prototype.toString.call(this)``
11243-
* - Chrome Worker === "[object global]"
11244-
* - Firefox Worker === "[object DedicatedWorkerGlobalScope]"
11245-
* - Safari Worker === "[object DedicatedWorkerGlobalScope]"
11246-
* - IE 11 Worker === "[object WorkerGlobalScope]"
11247-
* - IE Edge Worker === "[object WorkerGlobalScope]"
11248-
*/
11249-
if (obj === globalObject) {
11250-
return 'global';
11251-
}
11252-
11253-
/* ! Speed optimisation
11254-
* Pre:
11255-
* array literal x 2,888,352 ops/sec ±0.67% (82 runs sampled)
11256-
* Post:
11257-
* array literal x 22,479,650 ops/sec ±0.96% (81 runs sampled)
11258-
*/
11259-
if (
11260-
Array.isArray(obj) &&
11261-
(symbolToStringTagExists === false || !(Symbol.toStringTag in obj))
11262-
) {
11263-
return 'Array';
11264-
}
11265-
11266-
// Not caching existence of `window` and related properties due to potential
11267-
// for `window` to be unset before tests in quasi-browser environments.
11268-
if (typeof window === 'object' && window !== null) {
11269-
/* ! Spec Conformance
11270-
* (https://html.spec.whatwg.org/multipage/browsers.html#location)
11271-
* WhatWG HTML$7.7.3 - The `Location` interface
11272-
* Test: `Object.prototype.toString.call(window.location)``
11273-
* - IE <=11 === "[object Object]"
11274-
* - IE Edge <=13 === "[object Object]"
11275-
*/
11276-
if (typeof window.location === 'object' && obj === window.location) {
11277-
return 'Location';
11278-
}
11279-
11280-
/* ! Spec Conformance
11281-
* (https://html.spec.whatwg.org/#document)
11282-
* WhatWG HTML$3.1.1 - The `Document` object
11283-
* Note: Most browsers currently adher to the W3C DOM Level 2 spec
11284-
* (https://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268)
11285-
* which suggests that browsers should use HTMLTableCellElement for
11286-
* both TD and TH elements. WhatWG separates these.
11287-
* WhatWG HTML states:
11288-
* > For historical reasons, Window objects must also have a
11289-
* > writable, configurable, non-enumerable property named
11290-
* > HTMLDocument whose value is the Document interface object.
11291-
* Test: `Object.prototype.toString.call(document)``
11292-
* - Chrome === "[object HTMLDocument]"
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);
1137111293
}
11372-
}
1137311294

11374-
/* ! Speed optimisation
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;
1153611296

11537-
return Object
11538-
.prototype
11539-
.toString
11540-
.call(obj)
11541-
.slice(toStringLeftSliceLength, toStringRightSliceLength);
11542-
}
11543-
11544-
return typeDetect;
11545-
11546-
})));
11297+
}));
1154711298

1154811299
},{}]},{},[1])(1)
1154911300
});

Diff for: ‎package-lock.json

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"get-func-name": "^2.0.2",
4747
"loupe": "^2.3.6",
4848
"pathval": "^1.1.1",
49-
"type-detect": "^4.0.8"
49+
"type-detect": "^4.1.0"
5050
},
5151
"devDependencies": {
5252
"browserify": "^16.5.2",

0 commit comments

Comments
 (0)
Please sign in to comment.