core-js 3.32.0 → 3.32.2

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.
Files changed (108) hide show
  1. package/internals/add-to-unscopables.js +1 -1
  2. package/internals/array-buffer-byte-length.js +1 -1
  3. package/internals/array-buffer-transfer.js +1 -1
  4. package/internals/array-buffer.js +1 -1
  5. package/internals/array-includes.js +2 -2
  6. package/internals/array-iteration-from-last.js +1 -1
  7. package/internals/array-iteration.js +7 -7
  8. package/internals/array-slice-simple.js +2 -1
  9. package/internals/async-iterator-iteration.js +4 -4
  10. package/internals/caller.js +1 -1
  11. package/internals/check-correctness-of-iteration.js +3 -1
  12. package/internals/classof.js +2 -2
  13. package/internals/collection-strong.js +5 -5
  14. package/internals/collection.js +6 -6
  15. package/internals/date-to-iso-string.js +1 -1
  16. package/internals/descriptors.js +1 -1
  17. package/internals/engine-is-node.js +2 -1
  18. package/internals/fix-regexp-well-known-symbol-logic.js +5 -2
  19. package/internals/function-bind.js +3 -1
  20. package/internals/get-json-replacer-function.js +1 -1
  21. package/internals/get-set-record.js +1 -1
  22. package/internals/global.js +1 -1
  23. package/internals/host-report-errors.js +1 -1
  24. package/internals/ie8-dom-define.js +1 -1
  25. package/internals/ieee754.js +25 -14
  26. package/internals/indexed-object.js +1 -1
  27. package/internals/is-array.js +1 -1
  28. package/internals/is-big-int-array.js +1 -1
  29. package/internals/is-forced.js +2 -2
  30. package/internals/is-regexp.js +1 -1
  31. package/internals/iterator-define.js +7 -4
  32. package/internals/math-expm1.js +3 -2
  33. package/internals/math-fround.js +1 -1
  34. package/internals/math-scale.js +1 -1
  35. package/internals/math-sign.js +1 -1
  36. package/internals/number-parse-float.js +1 -1
  37. package/internals/numeric-range-iterator.js +1 -1
  38. package/internals/object-assign.js +2 -2
  39. package/internals/object-get-own-property-names-external.js +1 -1
  40. package/internals/object-is-extensible.js +1 -1
  41. package/internals/parse-json-string.js +3 -3
  42. package/internals/regexp-sticky-helpers.js +2 -2
  43. package/internals/same-value-zero.js +1 -1
  44. package/internals/same-value.js +1 -1
  45. package/internals/schedulers-fix.js +1 -1
  46. package/internals/shared.js +2 -2
  47. package/internals/string-pad.js +1 -1
  48. package/internals/string-punycode-to-ascii.js +4 -4
  49. package/internals/string-repeat.js +1 -1
  50. package/internals/structured-clone-proper-transfer.js +1 -1
  51. package/internals/symbol-constructor-detection.js +1 -1
  52. package/internals/symbol-is-well-known.js +1 -0
  53. package/internals/typed-array-constructor.js +2 -2
  54. package/internals/v8-prototype-define-bug.js +1 -1
  55. package/modules/es.array.for-each.js +1 -1
  56. package/modules/es.array.iterator.js +4 -3
  57. package/modules/es.array.join.js +1 -1
  58. package/modules/es.date.set-year.js +1 -1
  59. package/modules/es.date.to-string.js +1 -1
  60. package/modules/es.json.stringify.js +4 -4
  61. package/modules/es.math.acosh.js +2 -2
  62. package/modules/es.math.asinh.js +1 -1
  63. package/modules/es.math.atanh.js +1 -1
  64. package/modules/es.math.expm1.js +1 -1
  65. package/modules/es.math.imul.js +1 -1
  66. package/modules/es.math.sinh.js +1 -1
  67. package/modules/es.math.tanh.js +1 -1
  68. package/modules/es.number.constructor.js +14 -3
  69. package/modules/es.number.is-nan.js +1 -1
  70. package/modules/es.number.parse-float.js +1 -1
  71. package/modules/es.number.parse-int.js +1 -1
  72. package/modules/es.number.to-fixed.js +1 -1
  73. package/modules/es.object.is-frozen.js +1 -1
  74. package/modules/es.object.is-sealed.js +1 -1
  75. package/modules/es.parse-float.js +1 -1
  76. package/modules/es.parse-int.js +1 -1
  77. package/modules/es.promise.constructor.js +2 -2
  78. package/modules/es.reflect.construct.js +1 -1
  79. package/modules/es.regexp.constructor.js +2 -2
  80. package/modules/es.regexp.to-string.js +2 -2
  81. package/modules/es.string.from-code-point.js +1 -1
  82. package/modules/es.string.is-well-formed.js +2 -2
  83. package/modules/es.string.match-all.js +1 -1
  84. package/modules/es.string.replace.js +8 -3
  85. package/modules/es.string.split.js +4 -4
  86. package/modules/es.string.to-well-formed.js +2 -2
  87. package/modules/es.symbol.constructor.js +1 -1
  88. package/modules/es.symbol.description.js +1 -1
  89. package/modules/es.typed-array.to-locale-string.js +1 -1
  90. package/modules/es.typed-array.to-string.js +1 -1
  91. package/modules/es.weak-map.constructor.js +2 -2
  92. package/modules/esnext.array.last-index.js +1 -1
  93. package/modules/esnext.array.last-item.js +2 -2
  94. package/modules/esnext.async-disposable-stack.constructor.js +3 -3
  95. package/modules/esnext.composite-symbol.js +1 -1
  96. package/modules/esnext.disposable-stack.constructor.js +3 -3
  97. package/modules/esnext.json.parse.js +15 -15
  98. package/modules/esnext.json.raw-json.js +3 -3
  99. package/modules/esnext.math.signbit.js +1 -1
  100. package/modules/esnext.number.from-string.js +1 -1
  101. package/modules/esnext.set.intersection.v2.js +1 -1
  102. package/modules/esnext.string.dedent.js +8 -3
  103. package/modules/web.atob.js +2 -2
  104. package/modules/web.dom-exception.constructor.js +1 -1
  105. package/modules/web.structured-clone.js +4 -4
  106. package/modules/web.url.constructor.js +129 -125
  107. package/package.json +1 -1
  108. package/postinstall.js +1 -0
@@ -8,7 +8,7 @@ var ArrayPrototype = Array.prototype;
8
8
 
9
9
  // Array.prototype[@@unscopables]
10
10
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
11
- if (ArrayPrototype[UNSCOPABLES] == undefined) {
11
+ if (ArrayPrototype[UNSCOPABLES] === undefined) {
12
12
  defineProperty(ArrayPrototype, UNSCOPABLES, {
13
13
  configurable: true,
14
14
  value: create(null)
@@ -8,6 +8,6 @@ var $TypeError = TypeError;
8
8
  // - Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
9
9
  // - If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
10
10
  module.exports = uncurryThisAccessor(ArrayBuffer.prototype, 'byteLength', 'get') || function (O) {
11
- if (classof(O) != 'ArrayBuffer') throw $TypeError('ArrayBuffer expected');
11
+ if (classof(O) !== 'ArrayBuffer') throw $TypeError('ArrayBuffer expected');
12
12
  return O.byteLength;
13
13
  };
@@ -26,7 +26,7 @@ module.exports = PROPER_TRANSFER && function (arrayBuffer, newLength, preserveRe
26
26
  var fixedLength = !isResizable || !isResizable(arrayBuffer);
27
27
  if (isDetached(arrayBuffer)) throw TypeError('ArrayBuffer is detached');
28
28
  var newBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] });
29
- if (byteLength == newByteLength && (preserveResizability || fixedLength)) return newBuffer;
29
+ if (byteLength === newByteLength && (preserveResizability || fixedLength)) return newBuffer;
30
30
  if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) return slice(newBuffer, 0, newByteLength);
31
31
  var options = (preserveResizability && !fixedLength) && maxByteLength ? { maxByteLength: maxByteLength(newBuffer) } : undefined;
32
32
  var newNewBuffer = new ArrayBuffer(newByteLength, options);
@@ -212,7 +212,7 @@ if (!NATIVE_ARRAY_BUFFER) {
212
212
  new NativeArrayBuffer();
213
213
  new NativeArrayBuffer(1.5);
214
214
  new NativeArrayBuffer(NaN);
215
- return NativeArrayBuffer.length != 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
215
+ return NativeArrayBuffer.length !== 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
216
216
  })) {
217
217
  /* eslint-enable no-new -- required for testing */
218
218
  $ArrayBuffer = function ArrayBuffer(length) {
@@ -12,10 +12,10 @@ var createMethod = function (IS_INCLUDES) {
12
12
  var value;
13
13
  // Array#includes uses SameValueZero equality algorithm
14
14
  // eslint-disable-next-line no-self-compare -- NaN check
15
- if (IS_INCLUDES && el != el) while (length > index) {
15
+ if (IS_INCLUDES && el !== el) while (length > index) {
16
16
  value = O[index++];
17
17
  // eslint-disable-next-line no-self-compare -- NaN check
18
- if (value != value) return true;
18
+ if (value !== value) return true;
19
19
  // Array#indexOf ignores holes, Array#includes - not
20
20
  } else for (;length > index; index++) {
21
21
  if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
@@ -6,7 +6,7 @@ var lengthOfArrayLike = require('../internals/length-of-array-like');
6
6
 
7
7
  // `Array.prototype.{ findLast, findLastIndex }` methods implementation
8
8
  var createMethod = function (TYPE) {
9
- var IS_FIND_LAST_INDEX = TYPE == 1;
9
+ var IS_FIND_LAST_INDEX = TYPE === 1;
10
10
  return function ($this, callbackfn, that) {
11
11
  var O = toObject($this);
12
12
  var self = IndexedObject(O);
@@ -10,13 +10,13 @@ var push = uncurryThis([].push);
10
10
 
11
11
  // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
12
12
  var createMethod = function (TYPE) {
13
- var IS_MAP = TYPE == 1;
14
- var IS_FILTER = TYPE == 2;
15
- var IS_SOME = TYPE == 3;
16
- var IS_EVERY = TYPE == 4;
17
- var IS_FIND_INDEX = TYPE == 6;
18
- var IS_FILTER_REJECT = TYPE == 7;
19
- var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
13
+ var IS_MAP = TYPE === 1;
14
+ var IS_FILTER = TYPE === 2;
15
+ var IS_SOME = TYPE === 3;
16
+ var IS_EVERY = TYPE === 4;
17
+ var IS_FIND_INDEX = TYPE === 6;
18
+ var IS_FILTER_REJECT = TYPE === 7;
19
+ var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
20
20
  return function ($this, callbackfn, that, specificCreate) {
21
21
  var O = toObject($this);
22
22
  var self = IndexedObject(O);
@@ -11,7 +11,8 @@ module.exports = function (O, start, end) {
11
11
  var k = toAbsoluteIndex(start, length);
12
12
  var fin = toAbsoluteIndex(end === undefined ? length : end, length);
13
13
  var result = $Array(max(fin - k, 0));
14
- for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
14
+ var n = 0;
15
+ for (; k < fin; k++, n++) createProperty(result, n, O[k]);
15
16
  result.length = n;
16
17
  return result;
17
18
  };
@@ -11,10 +11,10 @@ var getIteratorDirect = require('../internals/get-iterator-direct');
11
11
  var closeAsyncIteration = require('../internals/async-iterator-close');
12
12
 
13
13
  var createMethod = function (TYPE) {
14
- var IS_TO_ARRAY = TYPE == 0;
15
- var IS_FOR_EACH = TYPE == 1;
16
- var IS_EVERY = TYPE == 2;
17
- var IS_SOME = TYPE == 3;
14
+ var IS_TO_ARRAY = TYPE === 0;
15
+ var IS_FOR_EACH = TYPE === 1;
16
+ var IS_EVERY = TYPE === 2;
17
+ var IS_SOME = TYPE === 3;
18
18
  return function (object, fn, target) {
19
19
  anObject(object);
20
20
  var MAPPING = fn !== undefined;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  module.exports = function (methodName, numArgs) {
3
- return numArgs == 1 ? function (object, arg) {
3
+ return numArgs === 1 ? function (object, arg) {
4
4
  return object[methodName](arg);
5
5
  } : function (object, arg1, arg2) {
6
6
  return object[methodName](arg1, arg2);
@@ -22,7 +22,9 @@ try {
22
22
  } catch (error) { /* empty */ }
23
23
 
24
24
  module.exports = function (exec, SKIP_CLOSING) {
25
- if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
25
+ try {
26
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
27
+ } catch (error) { return false; } // workaround of old WebKit + `eval` bug
26
28
  var ITERATION_SUPPORT = false;
27
29
  try {
28
30
  var object = {};
@@ -8,7 +8,7 @@ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
8
8
  var $Object = Object;
9
9
 
10
10
  // ES3 wrong here
11
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
11
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
12
12
 
13
13
  // fallback for IE11 Script Access Denied error
14
14
  var tryGet = function (it, key) {
@@ -26,5 +26,5 @@ module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
26
26
  // builtinTag case
27
27
  : CORRECT_ARGUMENTS ? classofRaw(O)
28
28
  // ES3 arguments fallback
29
- : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
29
+ : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
30
30
  };
@@ -69,7 +69,7 @@ module.exports = {
69
69
  if (index !== 'F') return state.index[index];
70
70
  // frozen object case
71
71
  for (entry = state.first; entry; entry = entry.next) {
72
- if (entry.key == key) return entry;
72
+ if (entry.key === key) return entry;
73
73
  }
74
74
  };
75
75
 
@@ -106,8 +106,8 @@ module.exports = {
106
106
  entry.removed = true;
107
107
  if (prev) prev.next = next;
108
108
  if (next) next.previous = prev;
109
- if (state.first == entry) state.first = next;
110
- if (state.last == entry) state.last = prev;
109
+ if (state.first === entry) state.first = next;
110
+ if (state.last === entry) state.last = prev;
111
111
  if (DESCRIPTORS) state.size--;
112
112
  else that.size--;
113
113
  } return !!entry;
@@ -194,8 +194,8 @@ module.exports = {
194
194
  return createIterResultObject(undefined, true);
195
195
  }
196
196
  // return step by kind
197
- if (kind == 'keys') return createIterResultObject(entry.key, false);
198
- if (kind == 'values') return createIterResultObject(entry.value, false);
197
+ if (kind === 'keys') return createIterResultObject(entry.key, false);
198
+ if (kind === 'values') return createIterResultObject(entry.value, false);
199
199
  return createIterResultObject([entry.key, entry.value], false);
200
200
  }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
201
201
 
@@ -27,14 +27,14 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
27
27
  var fixMethod = function (KEY) {
28
28
  var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]);
29
29
  defineBuiltIn(NativePrototype, KEY,
30
- KEY == 'add' ? function add(value) {
30
+ KEY === 'add' ? function add(value) {
31
31
  uncurriedNativeMethod(this, value === 0 ? 0 : value);
32
32
  return this;
33
- } : KEY == 'delete' ? function (key) {
33
+ } : KEY === 'delete' ? function (key) {
34
34
  return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
35
- } : KEY == 'get' ? function get(key) {
35
+ } : KEY === 'get' ? function get(key) {
36
36
  return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
37
- } : KEY == 'has' ? function has(key) {
37
+ } : KEY === 'has' ? function has(key) {
38
38
  return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
39
39
  } : function set(key, value) {
40
40
  uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
@@ -57,7 +57,7 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
57
57
  } else if (isForced(CONSTRUCTOR_NAME, true)) {
58
58
  var instance = new Constructor();
59
59
  // early implementations not supports chaining
60
- var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
60
+ var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance;
61
61
  // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false
62
62
  var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
63
63
  // most early implementations doesn't supports iterables, most modern - not close it correctly
@@ -96,7 +96,7 @@ module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
96
96
  }
97
97
 
98
98
  exported[CONSTRUCTOR_NAME] = Constructor;
99
- $({ global: true, constructor: true, forced: Constructor != NativeConstructor }, exported);
99
+ $({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported);
100
100
 
101
101
  setToStringTag(Constructor, CONSTRUCTOR_NAME);
102
102
 
@@ -21,7 +21,7 @@ var getUTCSeconds = uncurryThis(DatePrototype.getUTCSeconds);
21
21
  // https://tc39.es/ecma262/#sec-date.prototype.toisostring
22
22
  // PhantomJS / old WebKit fails here:
23
23
  module.exports = (fails(function () {
24
- return nativeDateToISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
24
+ return nativeDateToISOString.call(new Date(-5e13 - 1)) !== '0385-07-25T07:06:39.999Z';
25
25
  }) || !fails(function () {
26
26
  nativeDateToISOString.call(new Date(NaN));
27
27
  })) ? function toISOString() {
@@ -4,5 +4,5 @@ var fails = require('../internals/fails');
4
4
  // Detect IE8's incomplete defineProperty implementation
5
5
  module.exports = !fails(function () {
6
6
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
7
- return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
7
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
8
8
  });
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ var global = require('../internals/global');
2
3
  var classof = require('../internals/classof-raw');
3
4
 
4
- module.exports = typeof process != 'undefined' && classof(process) == 'process';
5
+ module.exports = classof(global.process) === 'process';
@@ -18,7 +18,7 @@ module.exports = function (KEY, exec, FORCED, SHAM) {
18
18
  // String methods call symbol-named RegEp methods
19
19
  var O = {};
20
20
  O[SYMBOL] = function () { return 7; };
21
- return ''[KEY](O) != 7;
21
+ return ''[KEY](O) !== 7;
22
22
  });
23
23
 
24
24
  var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
@@ -39,7 +39,10 @@ module.exports = function (KEY, exec, FORCED, SHAM) {
39
39
  re[SYMBOL] = /./[SYMBOL];
40
40
  }
41
41
 
42
- re.exec = function () { execCalled = true; return null; };
42
+ re.exec = function () {
43
+ execCalled = true;
44
+ return null;
45
+ };
43
46
 
44
47
  re[SYMBOL]('');
45
48
  return !execCalled;
@@ -13,7 +13,9 @@ var factories = {};
13
13
 
14
14
  var construct = function (C, argsLength, args) {
15
15
  if (!hasOwn(factories, argsLength)) {
16
- for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
16
+ var list = [];
17
+ var i = 0;
18
+ for (; i < argsLength; i++) list[i] = 'a[' + i + ']';
17
19
  factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
18
20
  } return factories[argsLength](C, args);
19
21
  };
@@ -15,7 +15,7 @@ module.exports = function (replacer) {
15
15
  for (var i = 0; i < rawLength; i++) {
16
16
  var element = replacer[i];
17
17
  if (typeof element == 'string') push(keys, element);
18
- else if (typeof element == 'number' || classof(element) == 'Number' || classof(element) == 'String') push(keys, toString(element));
18
+ else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') push(keys, toString(element));
19
19
  }
20
20
  var keysLength = keys.length;
21
21
  var root = true;
@@ -33,7 +33,7 @@ module.exports = function (obj) {
33
33
  var numSize = +obj.size;
34
34
  // NOTE: If size is undefined, then numSize will be NaN
35
35
  // eslint-disable-next-line no-self-compare -- NaN check
36
- if (numSize != numSize) throw $TypeError(INVALID_SIZE);
36
+ if (numSize !== numSize) throw $TypeError(INVALID_SIZE);
37
37
  var intSize = toIntegerOrInfinity(numSize);
38
38
  if (intSize < 0) throw $RangeError(INVALID_SIZE);
39
39
  return new SetRecord(
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  var check = function (it) {
3
- return it && it.Math == Math && it;
3
+ return it && it.Math === Math && it;
4
4
  };
5
5
 
6
6
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
@@ -2,6 +2,6 @@
2
2
  module.exports = function (a, b) {
3
3
  try {
4
4
  // eslint-disable-next-line no-console -- safe
5
- arguments.length == 1 ? console.error(a) : console.error(a, b);
5
+ arguments.length === 1 ? console.error(a) : console.error(a, b);
6
6
  } catch (error) { /* empty */ }
7
7
  };
@@ -8,5 +8,5 @@ module.exports = !DESCRIPTORS && !fails(function () {
8
8
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
9
9
  return Object.defineProperty(createElement('div'), 'a', {
10
10
  get: function () { return 7; }
11
- }).a != 7;
11
+ }).a !== 7;
12
12
  });
@@ -1,5 +1,8 @@
1
1
  'use strict';
2
2
  // IEEE754 conversions based on https://github.com/feross/ieee754
3
+ var sign = require('../internals/math-sign');
4
+ var trunc = require('../internals/math-trunc');
5
+
3
6
  var $Array = Array;
4
7
  var abs = Math.abs;
5
8
  var pow = Math.pow;
@@ -7,20 +10,28 @@ var floor = Math.floor;
7
10
  var log = Math.log;
8
11
  var LN2 = Math.LN2;
9
12
 
13
+ var roundToEven = function (number) {
14
+ var truncated = trunc(number);
15
+ var delta = abs(number - truncated);
16
+ if (delta > 0.5 || delta === 0.5 && truncated % 2 !== 0) {
17
+ return truncated + sign(number);
18
+ } return truncated;
19
+ };
20
+
10
21
  var pack = function (number, mantissaLength, bytes) {
11
22
  var buffer = $Array(bytes);
12
23
  var exponentLength = bytes * 8 - mantissaLength - 1;
13
24
  var eMax = (1 << exponentLength) - 1;
14
25
  var eBias = eMax >> 1;
15
26
  var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
16
- var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
27
+ var s = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
17
28
  var index = 0;
18
29
  var exponent, mantissa, c;
19
30
  number = abs(number);
20
31
  // eslint-disable-next-line no-self-compare -- NaN check
21
- if (number != number || number === Infinity) {
32
+ if (number !== number || number === Infinity) {
22
33
  // eslint-disable-next-line no-self-compare -- NaN check
23
- mantissa = number != number ? 1 : 0;
34
+ mantissa = number !== number ? 1 : 0;
24
35
  exponent = eMax;
25
36
  } else {
26
37
  exponent = floor(log(number) / LN2);
@@ -42,10 +53,10 @@ var pack = function (number, mantissaLength, bytes) {
42
53
  mantissa = 0;
43
54
  exponent = eMax;
44
55
  } else if (exponent + eBias >= 1) {
45
- mantissa = (number * c - 1) * pow(2, mantissaLength);
46
- exponent = exponent + eBias;
56
+ mantissa = roundToEven((number * c - 1) * pow(2, mantissaLength));
57
+ exponent += eBias;
47
58
  } else {
48
- mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
59
+ mantissa = roundToEven(number * pow(2, eBias - 1) * pow(2, mantissaLength));
49
60
  exponent = 0;
50
61
  }
51
62
  }
@@ -61,7 +72,7 @@ var pack = function (number, mantissaLength, bytes) {
61
72
  exponent /= 256;
62
73
  exponentLength -= 8;
63
74
  }
64
- buffer[--index] |= sign * 128;
75
+ buffer[--index] |= s * 128;
65
76
  return buffer;
66
77
  };
67
78
 
@@ -72,10 +83,10 @@ var unpack = function (buffer, mantissaLength) {
72
83
  var eBias = eMax >> 1;
73
84
  var nBits = exponentLength - 7;
74
85
  var index = bytes - 1;
75
- var sign = buffer[index--];
76
- var exponent = sign & 127;
86
+ var s = buffer[index--];
87
+ var exponent = s & 127;
77
88
  var mantissa;
78
- sign >>= 7;
89
+ s >>= 7;
79
90
  while (nBits > 0) {
80
91
  exponent = exponent * 256 + buffer[index--];
81
92
  nBits -= 8;
@@ -90,11 +101,11 @@ var unpack = function (buffer, mantissaLength) {
90
101
  if (exponent === 0) {
91
102
  exponent = 1 - eBias;
92
103
  } else if (exponent === eMax) {
93
- return mantissa ? NaN : sign ? -Infinity : Infinity;
104
+ return mantissa ? NaN : s ? -Infinity : Infinity;
94
105
  } else {
95
- mantissa = mantissa + pow(2, mantissaLength);
96
- exponent = exponent - eBias;
97
- } return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
106
+ mantissa += pow(2, mantissaLength);
107
+ exponent -= eBias;
108
+ } return (s ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
98
109
  };
99
110
 
100
111
  module.exports = {
@@ -12,5 +12,5 @@ module.exports = fails(function () {
12
12
  // eslint-disable-next-line no-prototype-builtins -- safe
13
13
  return !$Object('z').propertyIsEnumerable(0);
14
14
  }) ? function (it) {
15
- return classof(it) == 'String' ? split(it, '') : $Object(it);
15
+ return classof(it) === 'String' ? split(it, '') : $Object(it);
16
16
  } : $Object;
@@ -5,5 +5,5 @@ var classof = require('../internals/classof-raw');
5
5
  // https://tc39.es/ecma262/#sec-isarray
6
6
  // eslint-disable-next-line es/no-array-isarray -- safe
7
7
  module.exports = Array.isArray || function isArray(argument) {
8
- return classof(argument) == 'Array';
8
+ return classof(argument) === 'Array';
9
9
  };
@@ -3,5 +3,5 @@ var classof = require('../internals/classof');
3
3
 
4
4
  module.exports = function (it) {
5
5
  var klass = classof(it);
6
- return klass == 'BigInt64Array' || klass == 'BigUint64Array';
6
+ return klass === 'BigInt64Array' || klass === 'BigUint64Array';
7
7
  };
@@ -6,8 +6,8 @@ var replacement = /#|\.prototype\./;
6
6
 
7
7
  var isForced = function (feature, detection) {
8
8
  var value = data[normalize(feature)];
9
- return value == POLYFILL ? true
10
- : value == NATIVE ? false
9
+ return value === POLYFILL ? true
10
+ : value === NATIVE ? false
11
11
  : isCallable(detection) ? fails(detection)
12
12
  : !!detection;
13
13
  };
@@ -9,5 +9,5 @@ var MATCH = wellKnownSymbol('match');
9
9
  // https://tc39.es/ecma262/#sec-isregexp
10
10
  module.exports = function (it) {
11
11
  var isRegExp;
12
- return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
12
+ return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');
13
13
  };
@@ -30,12 +30,15 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
30
30
 
31
31
  var getIterationMethod = function (KIND) {
32
32
  if (KIND === DEFAULT && defaultIterator) return defaultIterator;
33
- if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
33
+ if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
34
+
34
35
  switch (KIND) {
35
36
  case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
36
37
  case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
37
38
  case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
38
- } return function () { return new IteratorConstructor(this); };
39
+ }
40
+
41
+ return function () { return new IteratorConstructor(this); };
39
42
  };
40
43
 
41
44
  var TO_STRING_TAG = NAME + ' Iterator';
@@ -45,7 +48,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
45
48
  || IterablePrototype['@@iterator']
46
49
  || DEFAULT && IterablePrototype[DEFAULT];
47
50
  var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
48
- var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
51
+ var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
49
52
  var CurrentIteratorPrototype, methods, KEY;
50
53
 
51
54
  // fix native
@@ -66,7 +69,7 @@ module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, I
66
69
  }
67
70
 
68
71
  // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
69
- if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
72
+ if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
70
73
  if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
71
74
  createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
72
75
  } else {
@@ -7,10 +7,11 @@ var exp = Math.exp;
7
7
  // https://tc39.es/ecma262/#sec-math.expm1
8
8
  module.exports = (!$expm1
9
9
  // Old FF bug
10
+ // eslint-disable-next-line no-loss-of-precision -- required for old engines
10
11
  || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
11
12
  // Tor Browser bug
12
- || $expm1(-2e-17) != -2e-17
13
+ || $expm1(-2e-17) !== -2e-17
13
14
  ) ? function expm1(x) {
14
15
  var n = +x;
15
- return n == 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp(n) - 1;
16
+ return n === 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp(n) - 1;
16
17
  } : $expm1;
@@ -24,6 +24,6 @@ module.exports = Math.fround || function fround(x) {
24
24
  a = (1 + EPSILON32 / EPSILON) * $abs;
25
25
  result = a - (a - $abs);
26
26
  // eslint-disable-next-line no-self-compare -- NaN check
27
- if (result > MAX32 || result != result) return $sign * Infinity;
27
+ if (result > MAX32 || result !== result) return $sign * Infinity;
28
28
  return $sign * result;
29
29
  };
@@ -8,7 +8,7 @@ module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh)
8
8
  var nOutLow = +outLow;
9
9
  var nOutHigh = +outHigh;
10
10
  // eslint-disable-next-line no-self-compare -- NaN check
11
- if (nx != nx || nInLow != nInLow || nInHigh != nInHigh || nOutLow != nOutLow || nOutHigh != nOutHigh) return NaN;
11
+ if (nx !== nx || nInLow !== nInLow || nInHigh !== nInHigh || nOutLow !== nOutLow || nOutHigh !== nOutHigh) return NaN;
12
12
  if (nx === Infinity || nx === -Infinity) return nx;
13
13
  return (nx - nInLow) * (nOutHigh - nOutLow) / (nInHigh - nInLow) + nOutLow;
14
14
  };
@@ -5,5 +5,5 @@
5
5
  module.exports = Math.sign || function sign(x) {
6
6
  var n = +x;
7
7
  // eslint-disable-next-line no-self-compare -- NaN check
8
- return n == 0 || n != n ? n : n < 0 ? -1 : 1;
8
+ return n === 0 || n !== n ? n : n < 0 ? -1 : 1;
9
9
  };
@@ -19,5 +19,5 @@ var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity
19
19
  module.exports = FORCED ? function parseFloat(string) {
20
20
  var trimmedString = trim(toString(string));
21
21
  var result = $parseFloat(trimmedString);
22
- return result === 0 && charAt(trimmedString, 0) == '-' ? -0 : result;
22
+ return result === 0 && charAt(trimmedString, 0) === '-' ? -0 : result;
23
23
  } : $parseFloat;
@@ -47,7 +47,7 @@ var $RangeIterator = createIteratorConstructor(function NumericRangeIterator(sta
47
47
  throw $RangeError(INCORRECT_RANGE);
48
48
  }
49
49
  // eslint-disable-next-line no-self-compare -- NaN check
50
- var hitsEnd = start != start || end != end || step != step || (end > start) !== (step > zero);
50
+ var hitsEnd = start !== start || end !== end || step !== step || (end > start) !== (step > zero);
51
51
  setInternalState(this, {
52
52
  type: NUMERIC_RANGE_ITERATOR,
53
53
  start: start,
@@ -32,11 +32,11 @@ module.exports = !$assign || fails(function () {
32
32
  var A = {};
33
33
  var B = {};
34
34
  // eslint-disable-next-line es/no-symbol -- safe
35
- var symbol = Symbol();
35
+ var symbol = Symbol('assign detection');
36
36
  var alphabet = 'abcdefghijklmnopqrst';
37
37
  A[symbol] = 7;
38
38
  alphabet.split('').forEach(function (chr) { B[chr] = chr; });
39
- return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
39
+ return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
40
40
  }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
41
41
  var T = toObject(target);
42
42
  var argumentsLength = arguments.length;
@@ -18,7 +18,7 @@ var getWindowNames = function (it) {
18
18
 
19
19
  // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
20
20
  module.exports.f = function getOwnPropertyNames(it) {
21
- return windowNames && classof(it) == 'Window'
21
+ return windowNames && classof(it) === 'Window'
22
22
  ? getWindowNames(it)
23
23
  : $getOwnPropertyNames(toIndexedObject(it));
24
24
  };
@@ -12,6 +12,6 @@ var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
12
12
  // https://tc39.es/ecma262/#sec-object.isextensible
13
13
  module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
14
14
  if (!isObject(it)) return false;
15
- if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) == 'ArrayBuffer') return false;
15
+ if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return false;
16
16
  return $isExtensible ? $isExtensible(it) : true;
17
17
  } : $isExtensible;
@@ -29,19 +29,19 @@ module.exports = function (source, i) {
29
29
  var value = '';
30
30
  while (i < source.length) {
31
31
  var chr = at(source, i);
32
- if (chr == '\\') {
32
+ if (chr === '\\') {
33
33
  var twoChars = slice(source, i, i + 2);
34
34
  if (hasOwn(codePoints, twoChars)) {
35
35
  value += codePoints[twoChars];
36
36
  i += 2;
37
- } else if (twoChars == '\\u') {
37
+ } else if (twoChars === '\\u') {
38
38
  i += 2;
39
39
  var fourHexDigits = slice(source, i, i + 4);
40
40
  if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw $SyntaxError('Bad Unicode escape at: ' + i);
41
41
  value += fromCharCode($parseInt(fourHexDigits, 16));
42
42
  i += 4;
43
43
  } else throw $SyntaxError('Unknown escape sequence: "' + twoChars + '"');
44
- } else if (chr == '"') {
44
+ } else if (chr === '"') {
45
45
  unterminated = false;
46
46
  i++;
47
47
  break;