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

Package detail

array.prototype.every

es-shims288.2kMIT1.1.7TypeScript support: definitely-typed

An ES5 spec-compliant Array.prototype.every shim/polyfill/replacement that works as far down as ES3.

Array.prototype.every, every, array, ES5, shim, polyfill, some, Array.prototype.some, es-shim API

readme

array.prototype.every Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

browser support

An ES5 spec-compliant Array.prototype.every shim/polyfill/replacement that works as far down as ES3.

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

Because Array.prototype.every depends on a receiver (the “this” value), the main export takes the array to operate on as the first argument.

Example

var every = require('array.prototype.every');
var assert = require('assert');

assert.equal(true, every([1, 1, 1], function (x) { return x === 1; }));
assert.equal(false, every([1, 0, 1], function (x) { return x === 1; }));
var every = require('array.prototype.every');
var assert = require('assert');
/* when Array#every is not present */
delete Array.prototype.every;
var shimmedEvery = every.shim();
assert.equal(shimmedEvery, every.getPolyfill());
var arr = [1, 2, 3];
var lessThan4 = function (x) { return x < 4; };
assert.deepEqual(arr.every(lessThan4), every(arr, lessThan4));
var every = require('array.prototype.every');
var assert = require('assert');
/* when Array#every is present */
var shimmedEvery = every.shim();
assert.equal(shimmedEvery, Array.prototype.every);
assert.deepEqual(arr.every(lessThan4), every(arr, lessThan4));

Tests

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

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.1.7 - 2024-12-11

Commits

  • [actions] split out node 10-20, and 20+ 5256a8f
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, auto-changelog, globalthis, tape 0d34a75
  • [Refactor] use call-bound instead of call-bind f4b1eca
  • [Deps] update call-bind, es-abstract, is-string 4e893eb
  • [Tests] replace aud with npm audit 96d1c28
  • [Dev Deps] add missing peer dep 7152082

v1.1.6 - 2024-03-16

Commits

  • [Refactor] update es-abstract, use es-object-atoms 536750d
  • [Dev Deps] update aud, npmignore, tape cd4fd18

v1.1.5 - 2023-08-27

Commits

  • [Deps] update define-properties, es-abstract 982cc25
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, aud, tape 89b319c

v1.1.4 - 2022-11-02

Commits

  • [actions] reuse common workflows 6546653
  • [meta] use npmignore to autogenerate an npmignore file ba0fd04
  • [Dev Deps] update eslint, @ljharb/eslint-config, @es-shims/api, safe-publish-latest, tape b25d031
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, functions-have-names, globalthis, tape 3414668
  • [Deps] update define-properties, es-abstract 4cf6ff7
  • [actions] update rebase action to use reusable workflow 6d80fe3
  • [actions] update codecov uploader 107705f
  • [Deps] update es-abstract 4e9fc6b

v1.1.3 - 2021-10-01

Commits

v1.1.2 - 2021-02-22

Commits

  • [meta] do not publish Github Action workflows 875e44c
  • [readme] remove travis badge 42a8e90
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, functions-have-names, has-strict-mode, tape 81950f0
  • [actions] update workflows f000ae2
  • [Deps] update call-bind, es-abstract b4cce25

v1.1.1 - 2020-11-17

Commits

  • [meta] remove testling html file 0e4e3d1
  • [Tests] migrate tests to Github Actions e107da3
  • [Deps] update es-abstract; add call-bind 21e8cbf
  • [Tests] use callBind from es-abstract instead of function-bind 13e3287
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape 76384a5
  • [Tests] run nyc on all tests add52e1
  • [actions] add "Allow Edits" workflow 72f2ee9
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape, functions-have-names 3a06d5f
  • [Tests] run all tests with tape 3fd6259
  • [Tests] run es-shim-api postlint ce2442b
  • [actions] switch Automatic Rebase workflow to pull_request_target event 69feacd
  • [Dev Deps] update auto-changelog; add aud ea2f06c
  • [Tests] only audit prod deps ca6b33a
  • [Deps] update es-abstract cc9aa32
  • [Dev Deps] update tape f2eea1c
  • [Deps] update es-abstract 4955e29

v1.1.0 - 2019-12-18

Commits

  • [Tests] use shared travis-ci configs f23f741
  • [Tests] up to node v12.6, v10.16, v9.11, v8.16, v7.10, v6.17, v4.9; use nvm install-latest-npm 680c7eb
  • [Dev Deps] update eslint, @ljharb/eslint-config, evalmd, functions-have-names, replace, safe-publish-latest, semver d98b942
  • [Dev Deps] update eslint, @ljharb/eslint-config, @es-shims/api, covert, function-bind, replace, safe-publish-latest, semver, tape e4bc0bd
  • [meta] add auto-changelog 8277082
  • [Tests] add has-strict-mode 5149665
  • [Tests] up to node v13.0, v12.13, v10.17 0c86b0a
  • [meta] move repo to es-shims org 163074c
  • [Refactor] use split-up es-abstract (78% bundle size decrease) 36e8b70
  • [actions] add automatic rebasing / merge commit blocking 4b651dc
  • [meta] create FUNDING.yml c10ee25
  • [Deps] update es-abstract 27f30c2
  • [meta] clean up scripts 019af7a
  • [Tests] use npx aud instead of nsp or npm audit with hoops 8d2af53
  • [Dev Deps] update eslint, tape f6b1877
  • Only apps should have lockfiles 3b2c8aa
  • [Deps] update es-abstract, is-string f12e77c
  • [Dev Deps] update @ljharb/eslint-config, safe-publish-latest 54046af
  • [Deps] update define-properties, es-abstract c8c874e
  • [Dev Deps] add safe-publish-latest 9fe7d43
  • [meta] add funding field ad8fb71
  • [Tests] use functions-have-names 0f085de
  • [New] add auto entry point f98b657
  • [Dev Deps] remove unused deps d7a5dbc
  • [Tests] temporarily allow coverage tests to fail, due to a bug in covert 9e4096e

v1.0.0 - 2016-11-22

Commits