8.8.81 • Published 10 months ago

@taktikorg/unde-soluta v8.8.81

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

@taktikorg/unde-soluta 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 @taktikorg/unde-soluta

Usage/Examples

var toSorted = require('@taktikorg/unde-soluta');
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('@taktikorg/unde-soluta');
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('@taktikorg/unde-soluta');
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

8.8.81

10 months ago

8.7.81

10 months ago

8.6.81

10 months ago

8.6.80

10 months ago

8.6.79

10 months ago

8.6.78

10 months ago

8.6.77

10 months ago

8.6.76

11 months ago

8.6.75

11 months ago

8.6.74

11 months ago

8.6.73

11 months ago

8.6.72

11 months ago

8.6.71

11 months ago

8.6.70

11 months ago

8.6.69

11 months ago

8.6.68

11 months ago

8.6.67

11 months ago

8.5.67

11 months ago

8.5.66

11 months ago

8.5.65

11 months ago

8.5.64

11 months ago

8.5.63

11 months ago

8.5.62

11 months ago

8.5.61

11 months ago

8.5.60

11 months ago

8.5.59

11 months ago

8.5.58

11 months ago

8.5.57

11 months ago

8.5.56

11 months ago

8.5.55

11 months ago

8.5.54

11 months ago

8.5.53

11 months ago

7.5.53

11 months ago

7.5.52

11 months ago

7.4.52

11 months ago

7.4.51

11 months ago

6.4.51

11 months ago

6.4.50

12 months ago

6.3.50

12 months ago

6.3.49

12 months ago

6.3.48

12 months ago

6.3.47

12 months ago

6.2.47

12 months ago

6.2.46

12 months ago

5.2.46

12 months ago

5.2.45

12 months ago

5.2.44

12 months ago

5.2.43

12 months ago

5.2.42

12 months ago

5.2.41

12 months ago

5.2.40

12 months ago

4.2.40

12 months ago

4.2.39

12 months ago

4.2.38

12 months ago

4.2.37

12 months ago

4.2.36

12 months ago

4.2.35

12 months ago

4.2.34

1 year ago

4.2.33

1 year ago

4.2.32

1 year ago

4.2.31

1 year ago

4.2.30

1 year ago

4.1.30

1 year ago

4.1.29

1 year ago

4.1.28

1 year ago

4.1.27

1 year ago

4.1.26

1 year ago

4.1.25

1 year ago

4.1.24

1 year ago

4.1.23

1 year ago

4.1.22

1 year ago

4.1.21

1 year ago

3.1.21

1 year ago

3.1.20

1 year ago

3.1.19

1 year ago

3.1.18

1 year ago

3.1.17

1 year ago

3.0.17

1 year ago

3.0.16

1 year ago

3.0.15

1 year ago

3.0.14

1 year ago

3.0.13

1 year ago

3.0.12

1 year ago

3.0.11

1 year ago

3.0.9

1 year ago

3.0.8

1 year ago

3.0.7

1 year ago

3.0.6

1 year ago

2.0.6

1 year ago

2.0.5

1 year ago

2.0.4

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