@parcel/utils 2.8.1 → 2.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcel/utils",
3
- "version": "2.8.1",
3
+ "version": "2.8.3",
4
4
  "description": "Blazing fast, zero configuration web application bundler",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -33,11 +33,11 @@
33
33
  }
34
34
  },
35
35
  "dependencies": {
36
- "@parcel/codeframe": "2.8.1",
37
- "@parcel/diagnostic": "2.8.1",
38
- "@parcel/hash": "2.8.1",
39
- "@parcel/logger": "2.8.1",
40
- "@parcel/markdown-ansi": "2.8.1",
36
+ "@parcel/codeframe": "2.8.3",
37
+ "@parcel/diagnostic": "2.8.3",
38
+ "@parcel/hash": "2.8.3",
39
+ "@parcel/logger": "2.8.3",
40
+ "@parcel/markdown-ansi": "2.8.3",
41
41
  "@parcel/source-map": "^2.1.1",
42
42
  "chalk": "^4.1.0"
43
43
  },
@@ -63,5 +63,5 @@
63
63
  "./src/http-server.js": false,
64
64
  "./src/openInBrowser.js": false
65
65
  },
66
- "gitHead": "f8d3fc30ca5b33d8f8674525f2a741d662c5986a"
66
+ "gitHead": "349a6caf40ec8abb6a49fcae0765f8f8deb2073d"
67
67
  }
package/src/collection.js CHANGED
@@ -41,6 +41,11 @@ export function setDifference<T>(a: Set<T>, b: Set<T>): Set<T> {
41
41
  difference.add(e);
42
42
  }
43
43
  }
44
+ for (let d of b) {
45
+ if (!a.has(d)) {
46
+ difference.add(d);
47
+ }
48
+ }
44
49
  return difference;
45
50
  }
46
51
 
@@ -1,7 +1,11 @@
1
1
  // @flow
2
2
 
3
3
  import assert from 'assert';
4
- import {objectSortedEntries, objectSortedEntriesDeep} from '../src/collection';
4
+ import {
5
+ objectSortedEntries,
6
+ objectSortedEntriesDeep,
7
+ setDifference,
8
+ } from '../src/collection';
5
9
 
6
10
  describe('objectSortedEntries', () => {
7
11
  it('returns a sorted list of key/value tuples', () => {
@@ -38,3 +42,11 @@ describe('objectSortedEntriesDeep', () => {
38
42
  );
39
43
  });
40
44
  });
45
+ describe('setDifference', () => {
46
+ it('returns a setDifference of two sets of T type', () => {
47
+ assert.deepEqual(
48
+ setDifference(new Set([1, 2, 3]), new Set([3, 4, 5])),
49
+ new Set([1, 2, 4, 5]),
50
+ );
51
+ });
52
+ });