Socket
Socket
Sign inDemoInstall

core-js-bundle

Package Overview
Dependencies
0
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    core-js-bundle

Standard library


Version published
Maintainers
1
Install size
1.24 MB
Created

Changelog

Source

3.24.0 - 2022.07.25

  • Recent updates of the iterator helpers proposal, #1101:
    • .asIndexedPairs renamed to .indexed, proposal-iterator-helpers/183:
      • Iterator.prototype.asIndexedPairs -> Iterator.prototype.indexed
      • AsyncIterator.prototype.asIndexedPairs -> AsyncIterator.prototype.indexed
    • Avoid exposing spec fiction %AsyncFromSyncIteratorPrototype% in AsyncIterator.from and Iterator.prototype.toAsync, proposal-iterator-helpers/182, proposal-iterator-helpers/202
    • Avoid unnecessary promise creation in %WrapForValidAsyncIteratorPrototype%.next, proposal-iterator-helpers/197
    • Do not validate value in %WrapForValid(Async)IteratorPrototype%.next, proposal-iterator-helpers/197 and proposal-iterator-helpers/205
    • Do not forward the parameter of .next / .return to an underlying iterator by the extended iterator protocol, a part of proposal-iterator-helpers/194
    • .throw methods removed from all wrappers / helpers prototypes, a part of proposal-iterator-helpers/194
    • Close inner iterators of { Iterator, AsyncIterator }.prototype.flatMap proxy iterators on .return, proposal-iterator-helpers/195
    • Throw RangeError on NaN in { Iterator, AsyncIterator }.prototype.{ drop, take }, proposal-iterator-helpers/181
    • Many other updates and fixes of this proposal
  • %TypedArray%.prototype.toSpliced method removed from the change array by copy proposal and marked as obsolete in core-js, proposal-change-array-by-copy/88
  • Polyfill Promise with unhandledrejection event support (browser style) in Deno < 1.24
  • Available new targets in core-js-compat / core-js-builder and added compat data for them:
    • Bun (bun), compat data for 0.1.1-0.1.5, #1103
    • Hermes (hermes), compat data for 0.1-0.11, #1099
    • Oculus Browser (oculus), compat data mapping for 3.0-22.0, #1098
  • Added Samsung Internet 18.0 compat data mapping

Readme

Source

logo

Open Collective version core-js downloads core-js-pure downloads tests eslint

Modular standard library for JavaScript. Includes polyfills for ECMAScript up to 2021: promises, symbols, collections, iterators, typed arrays, many other features, ECMAScript proposals, some cross-platform WHATWG / W3C features and proposals like URL. You can load only required features or use it without global namespace pollution.

As advertising: the author is looking for a good job -)

core-js@3, babel and a look into the future

Raising funds

core-js isn't backed by a company, so the future of this project depends on you. Become a sponsor or a backer if you are interested in core-js: Open Collective, Patreon, Bitcoin ( bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz ).




Example of usage:

import 'core-js/actual'; // <- at the top of your entry point

Array.from(new Set([1, 2, 3, 2, 1]));          // => [1, 2, 3]
[1, 2, 3, 4, 5].group(it => it % 2);           // => { 1: [1, 3, 5], 0: [2, 4] }
Promise.resolve(42).then(x => console.log(x)); // => 42
structuredClone(new Set([1, 2, 3]));           // => new Set([1, 2, 3])
queueMicrotask(() => console.log('called as microtask'));

You can load only required features:

import 'core-js/actual/array/from';       // <- at the top of your entry point
import 'core-js/actual/array/group';      // <- at the top of your entry point
import 'core-js/actual/set';              // <- at the top of your entry point
import 'core-js/actual/promise';          // <- at the top of your entry point
import 'core-js/actual/structured-clone'; // <- at the top of your entry point
import 'core-js/actual/queue-microtask';  // <- at the top of your entry point

Array.from(new Set([1, 2, 3, 2, 1]));          // => [1, 2, 3]
[1, 2, 3, 4, 5].group(it => it % 2);           // => { 1: [1, 3, 5], 0: [2, 4] }
Promise.resolve(42).then(x => console.log(x)); // => 42
structuredClone(new Set([1, 2, 3]));           // => new Set([1, 2, 3])
queueMicrotask(() => console.log('called as microtask'));

Or use it without global namespace pollution:

import from from 'core-js-pure/actual/array/from';
import group from 'core-js-pure/actual/array/group';
import Set from 'core-js-pure/actual/set';
import Promise from 'core-js-pure/actual/promise';
import structuredClone from 'core-js-pure/actual/structured-clone';
import queueMicrotask from 'core-js-pure/actual/queue-microtask';

from(new Set([1, 2, 3, 2, 1]));                // => [1, 2, 3]
group([1, 2, 3, 4, 5], it => it % 2);          // => { 1: [1, 3, 5], 0: [2, 4] }
Promise.resolve(42).then(x => console.log(x)); // => 42
structuredClone(new Set([1, 2, 3]));           // => new Set([1, 2, 3])
queueMicrotask(() => console.log('called as microtask'));

It's a bundled global version, for more info see core-js documentation.

Keywords

FAQs

Last updated on 25 Jul 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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