well-known-symbols

4.0.0 • Public • Published

well-known-symbols Version Badge

github actions coverage License Downloads

npm badge

An ESnext spec-compliant shim/polyfill/replacement for all Well-Known Symbols that works in any environment with Symbols.

New Well-Known Symbols will be added after they reach stage 3.

This package implements the es-shim API “multi” interface. It works in an ES3-supported environment and complies with the spec.

Note: functionality provided by this package prior to v4 can be found in:

Getting started

npm install --save well-known-symbols

Usage/Examples

const assert = require('assert');

require('well-known-symbols/auto');

assert.equal(typeof Symbol.asyncIterator, 'symbol');
assert.equal(typeof Symbol.hasInstance, 'symbol');
assert.equal(typeof Symbol.isConcatSpreadable, 'symbol');
assert.equal(typeof Symbol.iterator, 'symbol');
assert.equal(typeof Symbol.match, 'symbol');
assert.equal(typeof Symbol.matchAll, 'symbol');
assert.equal(typeof Symbol.replace, 'symbol');
assert.equal(typeof Symbol.search, 'symbol');
assert.equal(typeof Symbol.species, 'symbol');
assert.equal(typeof Symbol.split, 'symbol');
assert.equal(typeof Symbol.toPrimitive, 'symbol');
assert.equal(typeof Symbol.toStringTag, 'symbol');
assert.equal(typeof Symbol.unscopables, 'symbol');

Tests

Clone the repo, npm install, and run npm test

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 4.0.0
    800
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 4.0.0
    800
  • 3.0.0
    1
  • 2.0.0
    529,251
  • 1.0.0
    21,294

Package Sidebar

Install

npm i well-known-symbols

Weekly Downloads

551,346

Version

4.0.0

License

MIT

Unpacked Size

29.8 kB

Total Files

79

Last publish

Collaborators

  • ljharb
  • novemberborn