Socket
Socket
Sign inDemoInstall

core-js-pure

Package Overview
Dependencies
0
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.33.3 to 3.34.0

es/map/group-by.js

12

actual/map/group-by.js
'use strict';
require('../../modules/es.map');
var parent = require('../../stable/map/group-by');
require('../../modules/esnext.map.group-by');
var call = require('../../internals/function-call');
var isCallable = require('../../internals/is-callable');
var path = require('../../internals/path');
var Map = path.Map;
var mapGroupBy = Map.groupBy;
module.exports = function groupBy(source, iterable, keyDerivative) {
return call(mapGroupBy, isCallable(this) ? this : Map, source, iterable, keyDerivative);
};
module.exports = parent;
'use strict';
require('../../modules/es.object.create');
var parent = require('../../stable/object/group-by');
require('../../modules/esnext.object.group-by');
var path = require('../../internals/path');
module.exports = path.Object.groupBy;
module.exports = parent;
'use strict';
require('../../modules/es.promise');
var parent = require('../../stable/promise/with-resolvers');
// TODO: Remove from `core-js@4`
require('../../modules/esnext.promise.with-resolvers');
var call = require('../../internals/function-call');
var isCallable = require('../../internals/is-callable');
var path = require('../../internals/path');
var Promise = path.Promise;
var promiseWithResolvers = Promise.withResolvers;
module.exports = function withResolvers() {
return call(promiseWithResolvers, isCallable(this) ? this : Promise);
};
module.exports = parent;

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

require('../modules/es.map');
require('../modules/es.map.group-by');
require('../modules/es.math.acosh');

@@ -124,2 +125,3 @@ require('../modules/es.math.asinh');

require('../modules/es.object.get-prototype-of');
require('../modules/es.object.group-by');
require('../modules/es.object.has-own');

@@ -145,2 +147,3 @@ require('../modules/es.object.is');

require('../modules/es.promise.finally');
require('../modules/es.promise.with-resolvers');
require('../modules/es.reflect.apply');

@@ -147,0 +150,0 @@ require('../modules/es.reflect.construct');

'use strict';
require('../../modules/es.array.iterator');
require('../../modules/es.map');
require('../../modules/es.map.group-by');
require('../../modules/es.object.to-string');

@@ -5,0 +6,0 @@ require('../../modules/es.string.iterator');

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

require('../../modules/es.object.get-prototype-of');
require('../../modules/es.object.group-by');
require('../../modules/es.object.has-own');

@@ -16,0 +17,0 @@ require('../../modules/es.object.is');

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

require('../../modules/es.promise.any');
require('../../modules/es.promise.with-resolvers');
require('../../modules/es.promise.finally');

@@ -10,0 +11,0 @@ require('../../modules/es.string.iterator');

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

require('../modules/es.map');
require('../modules/es.map.group-by');
require('../modules/es.math.acosh');

@@ -124,2 +125,3 @@ require('../modules/es.math.asinh');

require('../modules/es.object.get-prototype-of');
require('../modules/es.object.group-by');
require('../modules/es.object.has-own');

@@ -145,2 +147,3 @@ require('../modules/es.object.is');

require('../modules/es.promise.finally');
require('../modules/es.promise.with-resolvers');
require('../modules/es.reflect.apply');

@@ -435,2 +438,6 @@ require('../modules/es.reflect.construct');

require('../modules/esnext.typed-array.with');
require('../modules/esnext.uint8-array.from-base64');
require('../modules/esnext.uint8-array.from-hex');
require('../modules/esnext.uint8-array.to-base64');
require('../modules/esnext.uint8-array.to-hex');
require('../modules/esnext.weak-map.delete-all');

@@ -437,0 +444,0 @@ require('../modules/esnext.weak-map.from');

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

require('../../modules/esnext.typed-array.unique-by');
require('../../modules/esnext.uint8-array.from-base64');
require('../../modules/esnext.uint8-array.from-hex');
require('../../modules/esnext.uint8-array.to-base64');
require('../../modules/esnext.uint8-array.to-hex');
module.exports = parent;

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

require('../../modules/esnext.typed-array.unique-by');
require('../../modules/esnext.uint8-array.from-base64');
require('../../modules/esnext.uint8-array.from-hex');
require('../../modules/esnext.uint8-array.to-base64');
require('../../modules/esnext.uint8-array.to-hex');
module.exports = parent;
'use strict';
var lengthOfArrayLike = require('../internals/length-of-array-like');
module.exports = function (Constructor, list) {
module.exports = function (Constructor, list, $length) {
var index = 0;
var length = lengthOfArrayLike(list);
var length = arguments.length > 2 ? $length : lengthOfArrayLike(list);
var result = new Constructor(length);

@@ -8,0 +8,0 @@ while (length > index) result[index] = list[index++];

@@ -13,4 +13,4 @@ 'use strict';

var self = IndexedObject(O);
var index = lengthOfArrayLike(self);
var boundFunction = bind(callbackfn, that);
var index = lengthOfArrayLike(self);
var value, result;

@@ -17,0 +17,0 @@ while (index-- > 0) {

@@ -23,4 +23,4 @@ 'use strict';

var self = IndexedObject(O);
var length = lengthOfArrayLike(self);
var boundFunction = bind(callbackfn, that);
var length = lengthOfArrayLike(self);
var index = 0;

@@ -27,0 +27,0 @@ var create = specificCreate || arraySpeciesCreate;

@@ -12,6 +12,6 @@ 'use strict';

return function (that, callbackfn, argumentsLength, memo) {
aCallable(callbackfn);
var O = toObject(that);
var self = IndexedObject(O);
var length = lengthOfArrayLike(O);
aCallable(callbackfn);
var index = IS_RIGHT ? length - 1 : 0;

@@ -18,0 +18,0 @@ var i = IS_RIGHT ? -1 : 1;

'use strict';
var itoc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
var ctoi = {};
var commonAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var base64Alphabet = commonAlphabet + '+/';
var base64UrlAlphabet = commonAlphabet + '-_';
for (var index = 0; index < 66; index++) ctoi[itoc.charAt(index)] = index;
var inverse = function (characters) {
// TODO: use `Object.create(null)` in `core-js@4`
var result = {};
var index = 0;
for (; index < 64; index++) result[characters.charAt(index)] = index;
return result;
};
module.exports = {
itoc: itoc,
ctoi: ctoi
i2c: base64Alphabet,
c2i: inverse(base64Alphabet),
i2cUrl: base64UrlAlphabet,
c2iUrl: inverse(base64UrlAlphabet)
};

@@ -12,4 +12,4 @@ 'use strict';

module.exports = function (it, TAG, STATIC, SET_METHOD) {
if (it) {
var target = STATIC ? it : it.prototype;
var target = STATIC ? it : it && it.prototype;
if (target) {
if (!hasOwn(target, TO_STRING_TAG)) {

@@ -16,0 +16,0 @@ defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });

@@ -8,7 +8,7 @@ 'use strict';

})('versions', []).push({
version: '3.33.3',
version: '3.34.0',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
license: 'https://github.com/zloirock/core-js/blob/v3.33.3/LICENSE',
license: 'https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE',
source: 'https://github.com/zloirock/core-js'
});

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

var anInstance = require('../internals/an-instance');
var anObject = require('../internals/an-object');
var isCallable = require('../internals/is-callable');
var getPrototypeOf = require('../internals/object-get-prototype-of');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
var createProperty = require('../internals/create-property');
var fails = require('../internals/fails');

@@ -13,8 +15,11 @@ var hasOwn = require('../internals/has-own-property');

var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;
var DESCRIPTORS = require('../internals/descriptors');
var IS_PURE = require('../internals/is-pure');
var CONSTRUCTOR = 'constructor';
var ITERATOR = 'Iterator';
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var $TypeError = TypeError;
var NativeIterator = global.Iterator;
var NativeIterator = global[ITERATOR];

@@ -33,8 +38,23 @@ // FF56- have non-standard global helper `Iterator`

if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) {
createNonEnumerableProperty(IteratorPrototype, TO_STRING_TAG, 'Iterator');
}
var defineIteratorPrototypeAccessor = function (key, value) {
if (DESCRIPTORS) {
defineBuiltInAccessor(IteratorPrototype, key, {
configurable: true,
get: function () {
return value;
},
set: function (replacement) {
anObject(this);
if (this === IteratorPrototype) throw new $TypeError("You can't redefine this property");
if (hasOwn(this, key)) this[key] = replacement;
else createProperty(this, key, replacement);
}
});
} else IteratorPrototype[key] = value;
};
if (FORCED || !hasOwn(IteratorPrototype, 'constructor') || IteratorPrototype.constructor === Object) {
createNonEnumerableProperty(IteratorPrototype, 'constructor', IteratorConstructor);
if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR);
if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) {
defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
}

@@ -41,0 +61,0 @@

'use strict';
var $ = require('../internals/export');
var uncurryThis = require('../internals/function-uncurry-this');
var aCallable = require('../internals/a-callable');
var requireObjectCoercible = require('../internals/require-object-coercible');
var iterate = require('../internals/iterate');
var MapHelpers = require('../internals/map-helpers');
var IS_PURE = require('../internals/is-pure');
var Map = MapHelpers.Map;
var has = MapHelpers.has;
var get = MapHelpers.get;
var set = MapHelpers.set;
var push = uncurryThis([].push);
// `Map.groupBy` method
// https://github.com/tc39/proposal-array-grouping
$({ target: 'Map', stat: true, forced: IS_PURE }, {
groupBy: function groupBy(items, callbackfn) {
requireObjectCoercible(items);
aCallable(callbackfn);
var map = new Map();
var k = 0;
iterate(items, function (value) {
var key = callbackfn(value, k++);
if (!has(map, key)) set(map, key, [value]);
else push(get(map, key), value);
});
return map;
}
});
// TODO: Remove from `core-js@4`
require('../modules/es.map.group-by');

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

if (parts.length > 1) mathNum += $parseInt(parts[1], R) / pow(R, parts[1].length);
if (numberToString(mathNum, R) !== string) throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION);
if (R === 10 && numberToString(mathNum, R) !== string) throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION);
return sign * mathNum;
}
});
'use strict';
var $ = require('../internals/export');
var getBuiltIn = require('../internals/get-built-in');
var uncurryThis = require('../internals/function-uncurry-this');
var aCallable = require('../internals/a-callable');
var requireObjectCoercible = require('../internals/require-object-coercible');
var toPropertyKey = require('../internals/to-property-key');
var iterate = require('../internals/iterate');
var create = getBuiltIn('Object', 'create');
var push = uncurryThis([].push);
// `Object.groupBy` method
// https://github.com/tc39/proposal-array-grouping
$({ target: 'Object', stat: true }, {
groupBy: function groupBy(items, callbackfn) {
requireObjectCoercible(items);
aCallable(callbackfn);
var obj = create(null);
var k = 0;
iterate(items, function (value) {
var key = toPropertyKey(callbackfn(value, k++));
// in some IE versions, `hasOwnProperty` returns incorrect result on integer keys
// but since it's a `null` prototype object, we can safely use `in`
if (key in obj) push(obj[key], value);
else obj[key] = [value];
});
return obj;
}
});
// TODO: Remove from `core-js@4`
require('../modules/es.object.group-by');
'use strict';
var $ = require('../internals/export');
var newPromiseCapabilityModule = require('../internals/new-promise-capability');
// `Promise.withResolvers` method
// https://github.com/tc39/proposal-promise-with-resolvers
$({ target: 'Promise', stat: true }, {
withResolvers: function withResolvers() {
var promiseCapability = newPromiseCapabilityModule.f(this);
return {
promise: promiseCapability.promise,
resolve: promiseCapability.resolve,
reject: promiseCapability.reject
};
}
});
// TODO: Remove from `core-js@4`
require('../modules/es.promise.with-resolvers');

@@ -9,5 +9,4 @@ 'use strict';

var toString = require('../internals/to-string');
var hasOwn = require('../internals/has-own-property');
var validateArgumentsLength = require('../internals/validate-arguments-length');
var ctoi = require('../internals/base64-map').ctoi;
var c2i = require('../internals/base64-map').c2i;

@@ -24,23 +23,29 @@ var disallowed = /[^\d+/a-z]/i;

var NO_SPACES_IGNORE = fails(function () {
var BASIC = !!$atob && !fails(function () {
return $atob('aGk=') !== 'hi';
});
var NO_SPACES_IGNORE = BASIC && fails(function () {
return $atob(' ') !== '';
});
var NO_ENCODING_CHECK = !fails(function () {
var NO_ENCODING_CHECK = BASIC && !fails(function () {
$atob('a');
});
var NO_ARG_RECEIVING_CHECK = !NO_SPACES_IGNORE && !NO_ENCODING_CHECK && !fails(function () {
var NO_ARG_RECEIVING_CHECK = BASIC && !fails(function () {
$atob();
});
var WRONG_ARITY = !NO_SPACES_IGNORE && !NO_ENCODING_CHECK && $atob.length !== 1;
var WRONG_ARITY = BASIC && $atob.length !== 1;
var FORCED = !BASIC || NO_SPACES_IGNORE || NO_ENCODING_CHECK || NO_ARG_RECEIVING_CHECK || WRONG_ARITY;
// `atob` method
// https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob
$({ global: true, bind: true, enumerable: true, forced: NO_SPACES_IGNORE || NO_ENCODING_CHECK || NO_ARG_RECEIVING_CHECK || WRONG_ARITY }, {
$({ global: true, bind: true, enumerable: true, forced: FORCED }, {
atob: function atob(data) {
validateArgumentsLength(arguments.length, 1);
// `webpack` dev server bug on IE global methods - use call(fn, global, ...)
if (NO_ARG_RECEIVING_CHECK || WRONG_ARITY) return call($atob, global, data);
if (BASIC && !NO_SPACES_IGNORE && !NO_ENCODING_CHECK) return call($atob, global, data);
var string = replace(toString(data), whitespaces, '');

@@ -50,16 +55,16 @@ var output = '';

var bc = 0;
var chr, bs;
var length, chr, bs;
if (string.length % 4 === 0) {
string = replace(string, finalEq, '');
}
if (string.length % 4 === 1 || exec(disallowed, string)) {
length = string.length;
if (length % 4 === 1 || exec(disallowed, string)) {
throw new (getBuiltIn('DOMException'))('The string is not correctly encoded', 'InvalidCharacterError');
}
while (chr = charAt(string, position++)) {
if (hasOwn(ctoi, chr)) {
bs = bc % 4 ? bs * 64 + ctoi[chr] : ctoi[chr];
if (bc++ % 4) output += fromCharCode(255 & bs >> (-2 * bc & 6));
}
while (position < length) {
chr = charAt(string, position++);
bs = bc % 4 ? bs * 64 + c2i[chr] : c2i[chr];
if (bc++ % 4) output += fromCharCode(255 & bs >> (-2 * bc & 6));
} return output;
}
});

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

var validateArgumentsLength = require('../internals/validate-arguments-length');
var itoc = require('../internals/base64-map').itoc;
var i2c = require('../internals/base64-map').i2c;

@@ -17,23 +17,27 @@ var $btoa = getBuiltIn('btoa');

var NO_ARG_RECEIVING_CHECK = !!$btoa && !fails(function () {
var BASIC = !!$btoa && !fails(function () {
return $btoa('hi') !== 'aGk=';
});
var NO_ARG_RECEIVING_CHECK = BASIC && !fails(function () {
$btoa();
});
var WRONG_ARG_CONVERSION = !!$btoa && fails(function () {
var WRONG_ARG_CONVERSION = BASIC && fails(function () {
return $btoa(null) !== 'bnVsbA==';
});
var WRONG_ARITY = !!$btoa && $btoa.length !== 1;
var WRONG_ARITY = BASIC && $btoa.length !== 1;
// `btoa` method
// https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa
$({ global: true, bind: true, enumerable: true, forced: NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY }, {
$({ global: true, bind: true, enumerable: true, forced: !BASIC || NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY }, {
btoa: function btoa(data) {
validateArgumentsLength(arguments.length, 1);
// `webpack` dev server bug on IE global methods - use call(fn, global, ...)
if (NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY) return call($btoa, global, toString(data));
if (BASIC) return call($btoa, global, toString(data));
var string = toString(data);
var output = '';
var position = 0;
var map = itoc;
var map = i2c;
var block, charCode;

@@ -40,0 +44,0 @@ while (charAt(string, position) || (map = '=', position % 1)) {

@@ -5,16 +5,8 @@ 'use strict';

var global = require('../internals/global');
var classof = require('../internals/classof');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var setToStringTag = require('../internals/set-to-string-tag');
var Iterators = require('../internals/iterators');
var wellKnownSymbol = require('../internals/well-known-symbol');
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
for (var COLLECTION_NAME in DOMIterables) {
var Collection = global[COLLECTION_NAME];
var CollectionPrototype = Collection && Collection.prototype;
if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
}
setToStringTag(global[COLLECTION_NAME], COLLECTION_NAME);
Iterators[COLLECTION_NAME] = Iterators.Array;
}
{
"name": "core-js-pure",
"version": "3.33.3",
"version": "3.34.0",
"type": "commonjs",

@@ -5,0 +5,0 @@ "description": "Standard library",

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

require('../modules/es.map');
require('../modules/es.map.group-by');
require('../modules/es.math.acosh');

@@ -124,2 +125,3 @@ require('../modules/es.math.asinh');

require('../modules/es.object.get-prototype-of');
require('../modules/es.object.group-by');
require('../modules/es.object.has-own');

@@ -145,2 +147,3 @@ require('../modules/es.object.is');

require('../modules/es.promise.finally');
require('../modules/es.promise.with-resolvers');
require('../modules/es.reflect.apply');

@@ -147,0 +150,0 @@ require('../modules/es.reflect.construct');

'use strict';
var parent = require('./3');
require('../proposals/array-buffer-base64');
require('../proposals/array-is-template-object');

@@ -5,0 +6,0 @@ require('../proposals/async-iterator-helpers');

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

require('../proposals/array-from-async-stage-2');
require('../proposals/array-grouping-v2');
require('../proposals/decorator-metadata-v2');

@@ -13,3 +12,2 @@ require('../proposals/explicit-resource-management');

require('../proposals/json-parse-with-source');
require('../proposals/promise-with-resolvers');
require('../proposals/set-methods-v2');

@@ -16,0 +14,0 @@ // TODO: Obsolete versions, remove from `core-js@4`

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

require('../proposals/array-find-from-last');
require('../proposals/array-grouping-v2');
require('../proposals/change-array-by-copy-stage-4');

@@ -11,2 +12,3 @@ // require('../proposals/error-cause');

require('../proposals/promise-any');
require('../proposals/promise-with-resolvers');
require('../proposals/relative-indexing-method');

@@ -13,0 +15,0 @@ require('../proposals/string-match-all');

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc