Skip to content

Commit

Permalink
Maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
Xotic750 committed Jan 31, 2020
1 parent 5787c70 commit f89108c
Show file tree
Hide file tree
Showing 11 changed files with 6,055 additions and 2,311 deletions.
42 changes: 35 additions & 7 deletions __tests__/collections-x.test.js
Expand Up @@ -81,7 +81,11 @@ methods.forEach((meth, methodNum) => {
const a = 1;
const b = {};
const c = new $Map();
const m = new $Map([[a, 1], [b, 2], [c, 3]]);
const m = new $Map([
[a, 1],
[b, 2],
[c, 3],
]);
expect(new $Map()).toStrictEqual(expect.any($Map));
expect(m.has(a)).toBe(true);
expect(m.has(b)).toBe(true);
Expand All @@ -99,7 +103,11 @@ methods.forEach((meth, methodNum) => {
const a = 1;
const b = {};
const c = new $Map();
const m = new $Map([[a, 1], [b, 2], [c, 3]]);
const m = new $Map([
[a, 1],
[b, 2],
[c, 3],
]);
const d = new $Map(m);
expect(d.has(a)).toBe(true);
expect(d.has(b)).toBe(true);
Expand Down Expand Up @@ -256,7 +264,11 @@ methods.forEach((meth, methodNum) => {

it('keys, values, entries behavior', function() {
expect.assertions(12); // test that things get returned in insertion order as per the specs
const o = new $Map([['1', 1], ['2', 2], ['3', 3]]);
const o = new $Map([
['1', 1],
['2', 2],
['3', 3],
]);
const keys = o.keys();
const values = o.values();
let k = keys.next();
Expand Down Expand Up @@ -310,7 +322,11 @@ methods.forEach((meth, methodNum) => {

it('forEach with mutations', function() {
expect.assertions(9);
const o = new $Map([['0', 0], ['1', 1], ['2', 2]]);
const o = new $Map([
['0', 0],
['1', 1],
['2', 2],
]);
const seen = [];
o.forEach(function(value, key, obj) {
seen.push(value);
Expand Down Expand Up @@ -382,14 +398,22 @@ methods.forEach((meth, methodNum) => {
expect(MyMap).not.toBe($Map);
expect(myMap).toBeInstanceOf(MyMap);
expect(myMap).toBeInstanceOf($Map);
expect(arr).toStrictEqual([['a', 'b'], ['c', 'd']]);
expect(arr).toStrictEqual([
['a', 'b'],
['c', 'd'],
]);
expect(myMap.mine).toBe('Yeah');
});

it('uses SameValueZero even on a Map of size > 4', function() {
expect.assertions(5); // Chrome 38-42, node 0.11/0.12, iojs 1/2 have a bug when the Map
// has a size > 4
const firstFour = [[1, 0], [2, 0], [3, 0], [4, 0]];
const firstFour = [
[1, 0],
[2, 0],
[3, 0],
[4, 0],
];
const fourMap = new $Map(firstFour);
expect(fourMap.size).toBe(4);
expect(fourMap.has(-0)).toBe(false);
Expand Down Expand Up @@ -639,7 +663,11 @@ methods.forEach((meth, methodNum) => {
mySet.forEach(function(value, key) {
arr.push([key, value]);
});
expect(arr).toStrictEqual([['a', 'a'], ['b', 'b'], ['c', 'c']]);
expect(arr).toStrictEqual([
['a', 'a'],
['b', 'b'],
['c', 'c'],
]);
expect(MySet).not.toBe($Set);
expect(mySet).toBeInstanceOf(MySet);
expect(mySet).toBeInstanceOf($Set);
Expand Down
8 changes: 6 additions & 2 deletions dist/collections-x.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/collections-x.esm.js.map

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions dist/collections-x.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/collections-x.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/collections-x.min.js

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions dist/collections-x.min.js.LICENSE.txt
@@ -0,0 +1,18 @@
/*!
* is-var-name | ISC (c) Shinnosuke Watanabe
* https://github.com/shinnn/is-var-name
*/

/*!
{
"author": "Graham Fairweather",
"copywrite": "Copyright (c) 2015-2017",
"date": "2020-01-31T00:26:08.066Z",
"describe": "",
"description": "ES6 collections fallback library: Map and Set.",
"file": "collections-x.min.js",
"hash": "757c07b6f598e0fbc185",
"license": "MIT",
"version": "3.1.2"
}
*/
2 changes: 1 addition & 1 deletion dist/collections-x.min.js.map

Large diffs are not rendered by default.

0 comments on commit f89108c

Please sign in to comment.