Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

core-js

Package Overview
Dependencies
Maintainers
1
Versions
276
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

core-js - npm Package Compare versions

Comparing version 3.25.0 to 3.25.1

internals/create-iter-result-object.js

5

internals/async-from-sync-iterator.js

@@ -10,2 +10,3 @@ 'use strict';

var AsyncIteratorPrototype = require('../internals/async-iterator-prototype');
var createIterResultObject = require('../internals/create-iter-result-object');

@@ -21,3 +22,3 @@ var Promise = getBuiltIn('Promise');

Promise.resolve(result.value).then(function (value) {
resolve({ value: value, done: done });
resolve(createIterResultObject(value, done));
}, reject);

@@ -46,3 +47,3 @@ };

var $return = getMethod(iterator, 'return');
if ($return === undefined) return resolve({ value: undefined, done: true });
if ($return === undefined) return resolve(createIterResultObject(undefined, true));
var result = anObject(call($return, iterator));

@@ -49,0 +50,0 @@ asyncFromSyncIteratorContinuation(result, resolve, reject);

7

internals/async-iterator-create-proxy.js

@@ -13,2 +13,3 @@ 'use strict';

var AsyncIteratorPrototype = require('../internals/async-iterator-prototype');
var createIterResultObject = require('../internals/create-iter-result-object');
var iteratorClose = require('../internals/iterator-close');

@@ -39,3 +40,3 @@

if (stateError || (IS_GENERATOR && state.done)) {
return { exit: true, value: stateError ? Promise.reject(state) : Promise.resolve({ value: undefined, done: true }) };
return { exit: true, value: stateError ? Promise.reject(state) : Promise.resolve(createIterResultObject(undefined, true)) };
} return { exit: false, value: state };

@@ -95,3 +96,3 @@ };

if (completion.error) return Promise.reject(result);
if (returnMethod === undefined) return Promise.resolve({ value: undefined, done: true });
if (returnMethod === undefined) return Promise.resolve(createIterResultObject(undefined, true));
completion = perform(function () {

@@ -104,3 +105,3 @@ return call(returnMethod, iterator);

anObject(resolved);
return { value: undefined, done: true };
return createIterResultObject(undefined, true);
});

@@ -107,0 +108,0 @@ });

@@ -7,2 +7,3 @@ 'use strict';

var createAsyncIteratorProxy = require('../internals/async-iterator-create-proxy');
var createIterResultObject = require('../internals/create-iter-result-object');

@@ -16,5 +17,5 @@ var AsyncIteratorProxy = createAsyncIteratorProxy(function (Promise) {

state.done = true;
return { value: undefined, done: true };
return createIterResultObject(undefined, true);
}
return { value: [state.index++, step.value], done: false };
return createIterResultObject([state.index++, step.value], false);
}).then(null, function (error) {

@@ -21,0 +22,0 @@ state.done = true;

@@ -10,2 +10,3 @@ 'use strict';

var defineIterator = require('../internals/iterator-define');
var createIterResultObject = require('../internals/create-iter-result-object');
var setSpecies = require('../internals/set-species');

@@ -193,8 +194,8 @@ var DESCRIPTORS = require('../internals/descriptors');

state.target = undefined;
return { value: undefined, done: true };
return createIterResultObject(undefined, true);
}
// return step by kind
if (kind == 'keys') return { value: entry.key, done: false };
if (kind == 'values') return { value: entry.value, done: false };
return { value: [entry.key, entry.value], done: false };
if (kind == 'keys') return createIterResultObject(entry.key, false);
if (kind == 'values') return createIterResultObject(entry.value, false);
return createIterResultObject([entry.key, entry.value], false);
}, IS_MAP ? 'entries' : 'values', !IS_MAP, true);

@@ -201,0 +202,0 @@

@@ -10,2 +10,3 @@ 'use strict';

var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;
var createIterResultObject = require('../internals/create-iter-result-object');
var iteratorClose = require('../internals/iterator-close');

@@ -33,3 +34,3 @@

var result = state.done ? undefined : state.nextHandler();
return { value: result, done: state.done };
return createIterResultObject(result, state.done);
} catch (error) {

@@ -46,3 +47,3 @@ state.done = true;

var returnMethod = getMethod(iterator, 'return');
return returnMethod ? call(returnMethod, iterator) : { value: undefined, done: true };
return returnMethod ? call(returnMethod, iterator) : createIterResultObject(undefined, true);
}

@@ -56,3 +57,3 @@ var innerIterator = state.innerIterator;

iteratorClose(iterator, 'return');
return { value: undefined, done: true };
return createIterResultObject(undefined, true);
}

@@ -59,0 +60,0 @@ });

'use strict';
var InternalStateModule = require('../internals/internal-state');
var createIteratorConstructor = require('../internals/iterator-create-constructor');
var createIterResultObject = require('../internals/create-iter-result-object');
var isNullOrUndefined = require('../internals/is-null-or-undefined');

@@ -67,3 +68,3 @@ var isObject = require('../internals/is-object');

var state = getInternalState(this);
if (state.hitsEnd) return { value: undefined, done: true };
if (state.hitsEnd) return createIterResultObject(undefined, true);
var start = state.start;

@@ -82,4 +83,5 @@ var end = state.end;

if (endCondition) {
return { value: undefined, done: state.hitsEnd = true };
} return { value: currentYieldingValue, done: false };
state.hitsEnd = true;
return createIterResultObject(undefined, true);
} return createIterResultObject(currentYieldingValue, false);
});

@@ -86,0 +88,0 @@

'use strict';
var InternalStateModule = require('../internals/internal-state');
var createIteratorConstructor = require('../internals/iterator-create-constructor');
var createIterResultObject = require('../internals/create-iter-result-object');
var hasOwn = require('../internals/has-own-property');

@@ -27,3 +28,3 @@ var objectKeys = require('../internals/object-keys');

state.object = state.keys = null;
return { value: undefined, done: true };
return createIterResultObject(undefined, true);
}

@@ -34,6 +35,6 @@ var key = keys[state.index++];

switch (state.mode) {
case 'keys': return { value: key, done: false };
case 'values': return { value: object[key], done: false };
} /* entries */ return { value: [key, object[key]], done: false };
case 'keys': return createIterResultObject(key, false);
case 'values': return createIterResultObject(object[key], false);
} /* entries */ return createIterResultObject([key, object[key]], false);
}
});

@@ -7,7 +7,7 @@ var IS_PURE = require('../internals/is-pure');

})('versions', []).push({
version: '3.25.0',
version: '3.25.1',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
license: 'https://github.com/zloirock/core-js/blob/v3.25.0/LICENSE',
license: 'https://github.com/zloirock/core-js/blob/v3.25.1/LICENSE',
source: 'https://github.com/zloirock/core-js'
});

@@ -9,3 +9,5 @@ var bind = require('../internals/function-bind-context');

var isArrayIteratorMethod = require('../internals/is-array-iterator-method');
var isBigIntArray = require('../internals/is-big-int-array');
var aTypedArrayConstructor = require('../internals/array-buffer-view-core').aTypedArrayConstructor;
var toBigInt = require('../internals/to-big-int');

@@ -19,3 +21,3 @@ module.exports = function from(source /* , mapfn, thisArg */) {

var iteratorMethod = getIteratorMethod(O);
var i, length, result, step, iterator, next;
var i, length, result, thisIsBigIntArray, value, step, iterator, next;
if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) {

@@ -34,6 +36,9 @@ iterator = getIterator(O, iteratorMethod);

result = new (aTypedArrayConstructor(C))(length);
thisIsBigIntArray = isBigIntArray(result);
for (i = 0; length > i; i++) {
result[i] = mapping ? mapfn(O[i], i) : O[i];
value = mapping ? mapfn(O[i], i) : O[i];
// FF30- typed arrays doesn't properly convert objects to typed array values
result[i] = thisIsBigIntArray ? toBigInt(value) : +value;
}
return result;
};

@@ -8,2 +8,3 @@ 'use strict';

var defineIterator = require('../internals/iterator-define');
var createIterResultObject = require('../internals/create-iter-result-object');
var IS_PURE = require('../internals/is-pure');

@@ -42,7 +43,7 @@ var DESCRIPTORS = require('../internals/descriptors');

state.target = undefined;
return { value: undefined, done: true };
return createIterResultObject(undefined, true);
}
if (kind == 'keys') return { value: index, done: false };
if (kind == 'values') return { value: target[index], done: false };
return { value: [index, target[index]], done: false };
if (kind == 'keys') return createIterResultObject(index, false);
if (kind == 'values') return createIterResultObject(target[index], false);
return createIterResultObject([index, target[index]], false);
}, 'values');

@@ -49,0 +50,0 @@

@@ -6,4 +6,4 @@ var $ = require('../internals/export');

// https://tc39.es/ecma262/#sec-globalthis
$({ global: true }, {
$({ global: true, forced: global.globalThis !== global }, {
globalThis: global
});

@@ -6,2 +6,3 @@ 'use strict';

var defineIterator = require('../internals/iterator-define');
var createIterResultObject = require('../internals/create-iter-result-object');

@@ -27,6 +28,6 @@ var STRING_ITERATOR = 'String Iterator';

var point;
if (index >= string.length) return { value: undefined, done: true };
if (index >= string.length) return createIterResultObject(undefined, true);
point = charAt(string, index);
state.index += point.length;
return { value: point, done: false };
return createIterResultObject(point, false);
});

@@ -7,2 +7,3 @@ 'use strict';

var createIteratorConstructor = require('../internals/iterator-create-constructor');
var createIterResultObject = require('../internals/create-iter-result-object');
var requireObjectCoercible = require('../internals/require-object-coercible');

@@ -51,13 +52,16 @@ var toLength = require('../internals/to-length');

var state = getInternalState(this);
if (state.done) return { value: undefined, done: true };
if (state.done) return createIterResultObject(undefined, true);
var R = state.regexp;
var S = state.string;
var match = regExpExec(R, S);
if (match === null) return { value: undefined, done: state.done = true };
if (match === null) {
state.done = true;
return createIterResultObject(undefined, true);
}
if (state.global) {
if (toString(match[0]) === '') R.lastIndex = advanceStringIndex(S, toLength(R.lastIndex), state.unicode);
return { value: match, done: false };
return createIterResultObject(match, false);
}
state.done = true;
return { value: match, done: false };
return createIterResultObject(match, false);
});

@@ -64,0 +68,0 @@

@@ -10,2 +10,3 @@ 'use strict';

var createAsyncIteratorProxy = require('../internals/async-iterator-create-proxy');
var createIterResultObject = require('../internals/create-iter-result-object');

@@ -27,7 +28,7 @@ var AsyncIteratorProxy = createAsyncIteratorProxy(function (Promise) {

state.done = true;
resolve({ value: undefined, done: true });
resolve(createIterResultObject(undefined, true));
} else if (state.remaining) {
state.remaining--;
loop();
} else resolve({ value: step.value, done: false });
} else resolve(createIterResultObject(step.value, false));
} catch (err) { doneAndReject(err); }

@@ -34,0 +35,0 @@ }, doneAndReject);

@@ -9,2 +9,3 @@ 'use strict';

var createAsyncIteratorProxy = require('../internals/async-iterator-create-proxy');
var createIterResultObject = require('../internals/create-iter-result-object');
var closeAsyncIteration = require('../internals/async-iterator-close');

@@ -33,3 +34,3 @@

state.done = true;
resolve({ value: undefined, done: true });
resolve(createIterResultObject(undefined, true));
} else {

@@ -39,3 +40,3 @@ var value = step.value;

Promise.resolve(filterer(value)).then(function (selected) {
selected ? resolve({ value: value, done: false }) : loop();
selected ? resolve(createIterResultObject(value, false)) : loop();
}, ifAbruptCloseAsyncIterator);

@@ -42,0 +43,0 @@ } catch (error3) { ifAbruptCloseAsyncIterator(error3); }

@@ -9,2 +9,3 @@ 'use strict';

var createAsyncIteratorProxy = require('../internals/async-iterator-create-proxy');
var createIterResultObject = require('../internals/create-iter-result-object');
var getAsyncIterator = require('../internals/get-async-iterator');

@@ -35,3 +36,3 @@ var closeAsyncIteration = require('../internals/async-iterator-close');

state.done = true;
resolve({ value: undefined, done: true });
resolve(createIterResultObject(undefined, true));
} else {

@@ -62,3 +63,3 @@ var value = step.value;

outerLoop();
} else resolve({ value: result.value, done: false });
} else resolve(createIterResultObject(result.value, false));
} catch (error1) { ifAbruptCloseAsyncIterator(error1); }

@@ -65,0 +66,0 @@ }, ifAbruptCloseAsyncIterator);

@@ -9,2 +9,3 @@ 'use strict';

var createAsyncIteratorProxy = require('../internals/async-iterator-create-proxy');
var createIterResultObject = require('../internals/create-iter-result-object');
var closeAsyncIteration = require('../internals/async-iterator-close');

@@ -31,3 +32,3 @@

state.done = true;
resolve({ value: undefined, done: true });
resolve(createIterResultObject(undefined, true));
} else {

@@ -37,3 +38,3 @@ var value = step.value;

Promise.resolve(mapper(value)).then(function (mapped) {
resolve({ value: mapped, done: false });
resolve(createIterResultObject(mapped, false));
}, ifAbruptCloseAsyncIterator);

@@ -40,0 +41,0 @@ } catch (error2) { ifAbruptCloseAsyncIterator(error2); }

@@ -10,2 +10,3 @@ 'use strict';

var createAsyncIteratorProxy = require('../internals/async-iterator-create-proxy');
var createIterResultObject = require('../internals/create-iter-result-object');

@@ -18,3 +19,3 @@ var AsyncIteratorProxy = createAsyncIteratorProxy(function (Promise) {

if (!state.remaining--) {
var resultDone = { value: undefined, done: true };
var resultDone = createIterResultObject(undefined, true);
state.done = true;

@@ -31,4 +32,4 @@ returnMethod = iterator['return'];

state.done = true;
return { value: undefined, done: true };
} return { value: step.value, done: false };
return createIterResultObject(undefined, true);
} return createIterResultObject(step.value, false);
}).then(null, function (error) {

@@ -35,0 +36,0 @@ state.done = true;

@@ -5,2 +5,3 @@ var $ = require('../internals/export');

var createIteratorConstructor = require('../internals/iterator-create-constructor');
var createIterResultObject = require('../internals/create-iter-result-object');
var InternalStateModule = require('../internals/internal-state');

@@ -23,3 +24,3 @@

var seed = state.seed = (state.seed * 1103515245 + 12345) % 2147483647;
return { value: (seed & 1073741823) / 1073741823, done: false };
return createIterResultObject((seed & 1073741823) / 1073741823, false);
});

@@ -26,0 +27,0 @@

'use strict';
var $ = require('../internals/export');
var createIteratorConstructor = require('../internals/iterator-create-constructor');
var createIterResultObject = require('../internals/create-iter-result-object');
var requireObjectCoercible = require('../internals/require-object-coercible');

@@ -27,6 +28,6 @@ var toString = require('../internals/to-string');

var point;
if (index >= string.length) return { value: undefined, done: true };
if (index >= string.length) return createIterResultObject(undefined, true);
point = charAt(string, index);
state.index += point.length;
return { value: { codePoint: codeAt(point, 0), position: index }, done: false };
return createIterResultObject({ codePoint: codeAt(point, 0), position: index }, false);
});

@@ -33,0 +34,0 @@

@@ -5,3 +5,5 @@ 'use strict';

var lengthOfArrayLike = require('../internals/length-of-array-like');
var isBigIntArray = require('../internals/is-big-int-array');
var toAbsoluteIndex = require('../internals/to-absolute-index');
var toBigInt = require('../internals/to-big-int');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');

@@ -40,3 +42,3 @@ var fails = require('../internals/fails');

var k = 0;
var insertCount, actualDeleteCount, convertedItems, newLen, A;
var insertCount, actualDeleteCount, thisIsBigIntArray, convertedItems, value, newLen, A;
if (argumentsLength === 0) {

@@ -52,4 +54,7 @@ insertCount = actualDeleteCount = 0;

convertedItems = new C(insertCount);
thisIsBigIntArray = isBigIntArray(convertedItems);
for (var i = 2; i < argumentsLength; i++) {
convertedItems[i - 2] = arguments[i];
value = arguments[i];
// FF30- typed arrays doesn't properly convert objects to typed array values
convertedItems[i - 2] = thisIsBigIntArray ? toBigInt(value) : +value;
}

@@ -56,0 +61,0 @@ }

{
"name": "core-js",
"description": "Standard library",
"version": "3.25.0",
"version": "3.25.1",
"repository": {

@@ -6,0 +6,0 @@ "type": "git",

![logo](https://user-images.githubusercontent.com/2213682/146607186-8e13ddef-26a4-4ebf-befd-5aac9d77c090.png)
[![Open Collective](https://opencollective.com/core-js/all/badge.svg?label=open%20collective)](https://opencollective.com/core-js) [![version](https://img.shields.io/npm/v/core-js.svg)](https://www.npmjs.com/package/core-js) [![core-js downloads](https://img.shields.io/npm/dm/core-js.svg?label=npm%20i%20core-js)](https://npm-stat.com/charts.html?package=core-js&package=core-js-pure&package=core-js-compat&from=2014-11-18) [![core-js-pure downloads](https://img.shields.io/npm/dm/core-js-pure.svg?label=npm%20i%20core-js-pure)](https://npm-stat.com/charts.html?package=core-js&package=core-js-pure&package=core-js-compat&from=2014-11-18) [![tests](https://github.com/zloirock/core-js/workflows/tests/badge.svg)](https://github.com/zloirock/core-js/actions) [![eslint](https://github.com/zloirock/core-js/workflows/eslint/badge.svg)](https://github.com/zloirock/core-js/actions)
[![fundraising](https://opencollective.com/core-js/all/badge.svg?label=fundraising)](https://opencollective.com/core-js) [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/zloirock/core-js/blob/master/CONTRIBUTING.md) [![version](https://img.shields.io/npm/v/core-js.svg)](https://www.npmjs.com/package/core-js) [![core-js downloads](https://img.shields.io/npm/dm/core-js.svg?label=npm%20i%20core-js)](https://npm-stat.com/charts.html?package=core-js&package=core-js-pure&package=core-js-compat&from=2014-11-18) [![core-js-pure downloads](https://img.shields.io/npm/dm/core-js-pure.svg?label=npm%20i%20core-js-pure)](https://npm-stat.com/charts.html?package=core-js&package=core-js-pure&package=core-js-compat&from=2014-11-18) [![tests](https://github.com/zloirock/core-js/workflows/tests/badge.svg)](https://github.com/zloirock/core-js/actions) [![eslint](https://github.com/zloirock/core-js/workflows/eslint/badge.svg)](https://github.com/zloirock/core-js/actions)

@@ -5,0 +5,0 @@ > Modular standard library for JavaScript. Includes polyfills for [ECMAScript up to 2023](https://github.com/zloirock/core-js#ecmascript): [promises](https://github.com/zloirock/core-js#ecmascript-promise), [symbols](https://github.com/zloirock/core-js#ecmascript-symbol), [collections](https://github.com/zloirock/core-js#ecmascript-collections), iterators, [typed arrays](https://github.com/zloirock/core-js#ecmascript-typed-arrays), many other features, [ECMAScript proposals](https://github.com/zloirock/core-js#ecmascript-proposals), [some cross-platform WHATWG / W3C features and proposals](#web-standards) like [`URL`](https://github.com/zloirock/core-js#url-and-urlsearchparams). You can load only required features or use it without global namespace pollution.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc