Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

es-shim-unscopables

ljharb116.4mMIT1.1.0TypeScript support: included

Helper package to shim a method into Array.prototype[Symbol.unscopables]

readme

es-shim-unscopables Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Helper package to shim a method into Array.prototype[Symbol.unscopables]

Example

const assert = require('assert');

const shimUnscopables = require('es-shim-unscopables');

let copyWithin;
let concat;
with ([]) {
    assert.equal(concat, Array.prototype.concat);
    assert.notEqual(copyWithin, Array.prototype.copyWithin);
}

shimUnscopables('concat');

with ([]) {
    assert.notEqual(concat, Array.prototype.concat);
    assert.notEqual(copyWithin, Array.prototype.copyWithin);
}

Tests

Simply clone the repo, npm install, and run npm test

Security

Please email @ljharb or see https://tidelift.com/security if you have a potential security vulnerability to report.

changelog

Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by auto-changelog.

v1.1.0

11 February 2025

  • [New] add types 2b94d6d
  • [Dev Deps] update @ljharb/eslint-config, auto-changelog, es-value-fixtures, for-each, npmignore, object-inspect, tape bc42bcf
  • [meta] add missing engines.node 9ffcc49

v1.0.2

20 October 2023

v1.0.1

20 October 2023

  • [meta] use npmignore to autogenerate an npmignore file 4f29eb9
  • [Refactor] use hasown instead of has 9d2577b
  • [actions] update checkout action 4525257

v1.0.0

11 April 2022

  • Initial implementation, tests 0313267
  • Initial commit 5a68e27
  • [meta] do not publish workflow files 4e29785