Skip to content

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

License

Notifications You must be signed in to change notification settings

es-shims/well-known-symbols

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 7, 2025
ca4b110 · Jan 7, 2025

History

28 Commits
Mar 2, 2023
Jan 7, 2025
Mar 2, 2023
Jan 7, 2025
Mar 2, 2023
Mar 2, 2023
Mar 2, 2023
Mar 2, 2023
Mar 2, 2023
Mar 2, 2023
Mar 2, 2023
Mar 2, 2023
Mar 2, 2023
Mar 2, 2023
Mar 2, 2023
Mar 2, 2023
Jan 7, 2025
Mar 2, 2023
Mar 2, 2023
Mar 2, 2023
Mar 2, 2023
Jan 7, 2025
Mar 2, 2023
Mar 2, 2023
Mar 2, 2023
Jan 7, 2025
Jan 7, 2025
Jan 7, 2025

Repository files navigation

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