5.2.75 • Published 1 year ago

@hishprorg/quod-ullam v5.2.75

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@hishprorg/quod-ullam Version Badge

dependency status dev dependency status License Downloads

npm badge

An ESnext spec-compliant Array.prototype.toSorted 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.toSorted 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 @hishprorg/quod-ullam

Usage/Examples

var toSorted = require('@hishprorg/quod-ullam');
var assert = require('assert');

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

var output = toSorted(input);

assert.deepEqual(output, [0, 1, 2, 3, 4, 5]);
assert.notEqual(output, input);
assert.deepEqual(input, [5, 4, 3, 2, 1, 0]);
var toSorted = require('@hishprorg/quod-ullam');
var assert = require('assert');
/* when Array#toSorted is not present */
delete Array.prototype.toSorted;
var shimmed = toSorted.shim();

assert.equal(shimmed, toSorted.getPolyfill());
assert.deepEqual(input.toSorted(), toSorted(input));
var toSorted = require('@hishprorg/quod-ullam');
var assert = require('assert');
/* when Array#toSorted is present */
var shimmed = toSorted.shim();

assert.equal(shimmed, Array.prototype.toSorted);
assert.deepEqual(input.toSorted(), toSorted(input));

Tests

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

5.2.75

1 year ago

5.2.74

1 year ago

5.2.73

1 year ago

5.2.72

1 year ago

5.2.71

1 year ago

5.2.70

1 year ago

5.1.70

1 year ago

4.1.70

1 year ago

4.1.69

1 year ago

4.1.68

1 year ago

4.1.67

1 year ago

4.1.66

1 year ago

4.1.65

1 year ago

4.1.64

1 year ago

4.1.63

1 year ago

4.1.62

1 year ago

4.1.61

1 year ago

4.1.60

1 year ago

4.1.59

1 year ago

4.1.58

1 year ago

4.1.57

1 year ago

4.1.56

1 year ago

4.1.55

1 year ago

4.1.54

1 year ago

3.1.54

1 year ago

3.1.53

1 year ago

2.1.53

1 year ago

2.1.52

1 year ago

2.1.51

1 year ago

2.1.50

1 year ago

2.1.49

1 year ago

2.1.48

1 year ago

2.1.47

1 year ago

2.1.46

1 year ago

2.1.45

1 year ago

2.1.44

1 year ago

2.0.44

1 year ago

2.0.43

1 year ago

2.0.42

1 year ago

2.0.41

1 year ago

2.0.40

1 year ago

2.0.39

1 year ago

2.0.38

1 year ago

2.0.37

1 year ago

2.0.36

1 year ago

2.0.35

1 year ago

2.0.34

1 year ago

2.0.33

1 year ago

2.0.32

1 year ago

2.0.31

1 year ago

2.0.30

1 year ago

1.0.30

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago