@atlaspack/utils 2.14.11 → 2.15.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @atlaspack/utils
2
2
 
3
+ ## 2.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#622](https://github.com/atlassian-labs/atlaspack/pull/622) [`e39c6cf`](https://github.com/atlassian-labs/atlaspack/commit/e39c6cf05f7e95ce5420dbcea66f401b1cbd397c) Thanks [@benjervis](https://github.com/benjervis)! - Add the `setIntersectStatic` method that doesn't mutate the passed in Sets
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`10fbcfb`](https://github.com/atlassian-labs/atlaspack/commit/10fbcfbfa49c7a83da5d7c40983e36e87f524a75), [`85c52d3`](https://github.com/atlassian-labs/atlaspack/commit/85c52d3f7717b3c84a118d18ab98cfbfd71dcbd2)]:
12
+ - @atlaspack/feature-flags@2.18.0
13
+
3
14
  ## 2.14.11
4
15
 
5
16
  ### Patch Changes
package/benchmark.js ADDED
@@ -0,0 +1,23 @@
1
+ require('@atlaspack/babel-register');
2
+ const b = require('benny');
3
+
4
+ const {setIntersect, setIntersectStatic} = require('./src/collection.js');
5
+
6
+ const setA = new Set([
7
+ 23, 25, 29, 29, 12, 16, 14, 23, 18, 19, 16, 24, 9, 29, 26,
8
+ ]);
9
+ const setB = new Set([24, 1, 3, 6, 1, 3, 1, 5, 20, 15, 21, 23, 13, 16, 6]);
10
+
11
+ b.suite(
12
+ 'Collection - set intersection',
13
+ b.add('Control', () => {
14
+ const setClone = new Set(setA);
15
+ return () => setIntersect(setClone, setB);
16
+ }),
17
+ b.add('setIntersectStatic', () => {
18
+ setIntersectStatic(setA, setB);
19
+ }),
20
+ b.configure({minSamples: 100}),
21
+ b.cycle(),
22
+ b.complete(),
23
+ );
package/lib/index.js CHANGED
@@ -3447,6 +3447,7 @@ $parcel$export(module.exports, "setDifference", () => $2ee306eb47a905ca$export$8
3447
3447
  $parcel$export(module.exports, "setSymmetricDifference", () => $2ee306eb47a905ca$export$be646fbd7a3fda37);
3448
3448
  $parcel$export(module.exports, "setEqual", () => $2ee306eb47a905ca$export$dd7d5a65a6b6780f);
3449
3449
  $parcel$export(module.exports, "setIntersect", () => $2ee306eb47a905ca$export$9404cfefeb010e68);
3450
+ $parcel$export(module.exports, "setIntersectStatic", () => $2ee306eb47a905ca$export$25266bb285978950);
3450
3451
  $parcel$export(module.exports, "setUnion", () => $2ee306eb47a905ca$export$667066422fa0af46);
3451
3452
  $parcel$export(module.exports, "resolveConfig", () => $cc7044c885d3b7c6$export$7eca4ea16d4c8343);
3452
3453
  $parcel$export(module.exports, "resolveConfigSync", () => $cc7044c885d3b7c6$export$d175e66e9fcd7b75);
@@ -36716,6 +36717,11 @@ function $2ee306eb47a905ca$export$be646fbd7a3fda37(a, b) {
36716
36717
  function $2ee306eb47a905ca$export$9404cfefeb010e68(a, b) {
36717
36718
  for (let entry of a)if (!b.has(entry)) a.delete(entry);
36718
36719
  }
36720
+ function $2ee306eb47a905ca$export$25266bb285978950(a, b) {
36721
+ let intersection = new Set();
36722
+ for (let entry of a)if (b.has(entry)) intersection.add(entry);
36723
+ return intersection;
36724
+ }
36719
36725
  function $2ee306eb47a905ca$export$667066422fa0af46(a, b) {
36720
36726
  return new Set([
36721
36727
  ...a,