core-js-pure 3.35.0 → 3.35.1

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014-2023 Denis Pushkarev
1
+ Copyright (c) 2014-2024 Denis Pushkarev
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -45,7 +45,7 @@ module.exports = function (options, source) {
45
45
  var STATIC = options.stat;
46
46
  var PROTO = options.proto;
47
47
 
48
- var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype;
48
+ var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : global[TARGET] && global[TARGET].prototype;
49
49
 
50
50
  var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];
51
51
  var targetPrototype = target.prototype;
@@ -68,7 +68,7 @@ module.exports = function (options, source) {
68
68
  // export native or implementation
69
69
  sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];
70
70
 
71
- if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;
71
+ if (!FORCED && !PROTO && typeof targetProperty == typeof sourceProperty) continue;
72
72
 
73
73
  // bind methods to global for calling from export context
74
74
  if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);
@@ -7,7 +7,6 @@ var getBuiltIn = require('../internals/get-built-in');
7
7
  var inspectSource = require('../internals/inspect-source');
8
8
 
9
9
  var noop = function () { /* empty */ };
10
- var empty = [];
11
10
  var construct = getBuiltIn('Reflect', 'construct');
12
11
  var constructorRegExp = /^\s*(?:class|function)\b/;
13
12
  var exec = uncurryThis(constructorRegExp.exec);
@@ -16,7 +15,7 @@ var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
16
15
  var isConstructorModern = function isConstructor(argument) {
17
16
  if (!isCallable(argument)) return false;
18
17
  try {
19
- construct(noop, empty, argument);
18
+ construct(noop, [], argument);
20
19
  return true;
21
20
  } catch (error) {
22
21
  return false;
@@ -5,9 +5,9 @@ var store = require('../internals/shared-store');
5
5
  (module.exports = function (key, value) {
6
6
  return store[key] || (store[key] = value !== undefined ? value : {});
7
7
  })('versions', []).push({
8
- version: '3.35.0',
8
+ version: '3.35.1',
9
9
  mode: IS_PURE ? 'pure' : 'global',
10
- copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
11
- license: 'https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE',
10
+ copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
11
+ license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',
12
12
  source: 'https://github.com/zloirock/core-js'
13
13
  });
@@ -6,5 +6,6 @@ var min = Math.min;
6
6
  // `ToLength` abstract operation
7
7
  // https://tc39.es/ecma262/#sec-tolength
8
8
  module.exports = function (argument) {
9
- return argument > 0 ? min(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
9
+ var len = toIntegerOrInfinity(argument);
10
+ return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
10
11
  };
@@ -20,12 +20,6 @@ var replace = uncurryThis(''.replace);
20
20
  var stringSlice = uncurryThis(''.slice);
21
21
  var max = Math.max;
22
22
 
23
- var stringIndexOf = function (string, searchValue, fromIndex) {
24
- if (fromIndex > string.length) return -1;
25
- if (searchValue === '') return fromIndex;
26
- return indexOf(string, searchValue, fromIndex);
27
- };
28
-
29
23
  // `String.prototype.replaceAll` method
30
24
  // https://tc39.es/ecma262/#sec-string.prototype.replaceall
31
25
  $({ target: 'String', proto: true }, {
@@ -54,14 +48,14 @@ $({ target: 'String', proto: true }, {
54
48
  if (!functionalReplace) replaceValue = toString(replaceValue);
55
49
  searchLength = searchString.length;
56
50
  advanceBy = max(1, searchLength);
57
- position = stringIndexOf(string, searchString, 0);
51
+ position = indexOf(string, searchString);
58
52
  while (position !== -1) {
59
53
  replacement = functionalReplace
60
54
  ? toString(replaceValue(searchString, position, string))
61
55
  : getSubstitution(searchString, string, position, [], undefined, replaceValue);
62
56
  result += stringSlice(string, endOfLastMatch, position) + replacement;
63
57
  endOfLastMatch = position + searchLength;
64
- position = stringIndexOf(string, searchString, position + advanceBy);
58
+ position = position + advanceBy > string.length ? -1 : indexOf(string, searchString, position + advanceBy);
65
59
  }
66
60
  if (endOfLastMatch < string.length) {
67
61
  result += stringSlice(string, endOfLastMatch);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-js-pure",
3
- "version": "3.35.0",
3
+ "version": "3.35.1",
4
4
  "type": "commonjs",
5
5
  "description": "Standard library",
6
6
  "keywords": [