3.6.63 • Published 9 months ago

@zitterorg/libero-exercitationem v3.6.63

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@zitterorg/libero-exercitationem Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

An ESnext spec-compliant Array.prototype.findLast 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.findLast 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 @zitterorg/libero-exercitationem

Usage/Examples

var findLast = require('@zitterorg/libero-exercitationem');
var assert = require('assert');

var arr = [1, [2], [], 3, [[4]]];
var isNumber = function (x) { return typeof x === 'number' };

assert.deepEqual(findLast(arr, isNumber), 3);
var findLast = require('@zitterorg/libero-exercitationem');
var assert = require('assert');
/* when Array#findLast is not present */
delete Array.prototype.findLast;
var shimmed = findLast.shim();

assert.equal(shimmed, findLast.getPolyfill());
assert.deepEqual(arr.findLast(isNumber), findLast(arr, isNumber));
var findLast = require('@zitterorg/libero-exercitationem');
var assert = require('assert');
/* when Array#findLast is present */
var shimmed = findLast.shim();

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

Tests

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

3.6.63

9 months ago

3.6.62

10 months ago

3.6.61

10 months ago

3.6.60

10 months ago

3.6.59

10 months ago

3.6.58

10 months ago

3.6.57

10 months ago

3.6.56

10 months ago

3.5.54

10 months ago

3.6.55

10 months ago

3.6.54

10 months ago

3.5.53

10 months ago

3.5.52

10 months ago

3.5.51

10 months ago

3.5.50

10 months ago

3.4.47

10 months ago

3.3.35

11 months ago

3.4.48

10 months ago

3.3.36

10 months ago

3.2.23

11 months ago

3.4.49

10 months ago

3.3.37

10 months ago

3.3.38

10 months ago

3.3.39

10 months ago

3.3.30

11 months ago

3.3.31

11 months ago

3.2.20

11 months ago

3.3.32

11 months ago

3.3.33

11 months ago

3.2.22

11 months ago

3.3.34

11 months ago

3.2.21

11 months ago

3.3.46

10 months ago

3.3.47

10 months ago

3.3.40

10 months ago

3.3.41

10 months ago

3.3.42

10 months ago

3.3.43

10 months ago

3.3.44

10 months ago

3.3.45

10 months ago

3.3.24

11 months ago

3.3.25

11 months ago

3.3.26

11 months ago

3.2.15

11 months ago

3.3.27

11 months ago

3.2.14

11 months ago

3.3.28

11 months ago

3.2.17

11 months ago

3.3.29

11 months ago

3.2.16

11 months ago

3.2.19

11 months ago

3.2.18

11 months ago

3.5.49

10 months ago

3.3.23

11 months ago

3.2.13

11 months ago

3.2.12

11 months ago

3.2.11

11 months ago

3.2.10

11 months ago

2.2.10

11 months ago

2.2.9

11 months ago

2.2.8

11 months ago

2.2.7

12 months ago

2.2.6

12 months ago

2.1.6

12 months ago

2.1.5

12 months ago

1.1.5

12 months ago

1.1.4

12 months ago

1.1.3

12 months ago

1.1.2

12 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.0.0

12 months ago