Detalhes do pacote

array.prototype.toreversed

es-shims7.2mMIT1.1.2

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

ecmascript, javascript, polyfill, shim

readme (leia-me)

array.prototype.toreversed Version Badge

dependency status dev dependency status License Downloads

npm badge

An ESnext spec-compliant Array.prototype.toReversed 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.toReversed depends on a receiver (the this value), the main export takes the array to operate on as the first argument.

Getting started

npm install --save array.prototype.toreversed

Usage/Examples

var toReversed = require('array.prototype.toreversed');
var assert = require('assert');

var arr = [0, 1, 2, 3, 4, 5];

var results = toReversed(arr);

assert.deepEqual(results, [5, 4, 3, 2, 1, 0]);
assert.deepEqual(arr, [0, 1, 2, 3, 4, 5]);
var toReversed = require('array.prototype.toreversed');
var assert = require('assert');
/* when Array#toReversed is not present */
delete Array.prototype.toReversed;
var shimmed = toReversed.shim();

assert.equal(shimmed, toReversed.getPolyfill());
assert.deepEqual(arr.toReversed(), toReversed(arr));
var toReversed = require('array.prototype.toreversed');
var assert = require('assert');
/* when Array#toReversed is present */
var shimmed = toReversed.shim();

assert.equal(shimmed, Array.prototype.toReversed);
assert.deepEqual(arr.toReversed(), toReversed(arr));

Tests

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

changelog (log de mudanças)

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.2 - 2023-09-07

Commits

  • [Deps] update define-properties, es-abstract 93c863a
  • [Dev Deps] update @es-shims/api, @ljharb/eslint-config, aud, tape c551e3f

v1.1.1 - 2022-11-03

Commits

  • [Deps] update es-abstract 6bf5a4f
  • [actions] update rebase action to use reusable workflow d4956c3
  • [Dev Deps] update aud, tape e3a33ff

v1.1.0 - 2022-08-14

Commits

v1.0.1 - 2022-04-02

Commits

  • [Fix] use a full matching implementation 134ead0
  • [readme] fix spec link 325d830

v1.0.0 - 2022-03-31

Commits

  • initial implementation, tests, readme cb3dd89
  • Initial commit b6b34b1
  • [meta] do not publish workflow files dc40bf6
  • [Tests] temporarily use actions instead of composable workflows b0bb153
  • npm init 5326445
  • [Refactor] use slice/reverse instead of explicit spec steps acfe9a8
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape 7925aa5
  • [meta] add version script 7fc3e55
  • Only apps should have lockfiles b646ff8
  • [Deps] remove unused dep 0d907c2