@xylabs/set 2.11.7 → 2.11.9

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.
Files changed (100) hide show
  1. package/dist/{index.d.mts.map → browser/index.d.mts.map} +1 -1
  2. package/dist/{index.d.ts.map → browser/index.d.ts.map} +1 -1
  3. package/dist/browser/index.js +2 -0
  4. package/dist/browser/index.js.map +1 -0
  5. package/dist/browser/lib/difference.d.mts.map +1 -0
  6. package/dist/browser/lib/difference.d.ts.map +1 -0
  7. package/dist/browser/lib/difference.js +7 -0
  8. package/dist/browser/lib/difference.js.map +1 -0
  9. package/dist/browser/lib/index.d.mts.map +1 -0
  10. package/dist/browser/lib/index.d.ts.map +1 -0
  11. package/dist/browser/lib/index.js +4 -0
  12. package/dist/browser/lib/index.js.map +1 -0
  13. package/dist/browser/lib/intersection.d.mts.map +1 -0
  14. package/dist/browser/lib/intersection.d.ts.map +1 -0
  15. package/dist/browser/lib/intersection.js +7 -0
  16. package/dist/browser/lib/intersection.js.map +1 -0
  17. package/dist/browser/lib/spec/difference.spec.js +14 -0
  18. package/dist/browser/lib/spec/difference.spec.js.map +1 -0
  19. package/dist/browser/lib/spec/intersection.spec.js +14 -0
  20. package/dist/browser/lib/spec/intersection.spec.js.map +1 -0
  21. package/dist/browser/lib/spec/union.spec.js +14 -0
  22. package/dist/browser/lib/spec/union.spec.js.map +1 -0
  23. package/dist/browser/lib/union.d.mts.map +1 -0
  24. package/dist/browser/lib/union.d.ts.map +1 -0
  25. package/dist/browser/lib/union.js +7 -0
  26. package/dist/browser/lib/union.js.map +1 -0
  27. package/dist/node/index.d.mts +2 -0
  28. package/dist/node/index.d.mts.map +1 -0
  29. package/dist/node/index.d.ts +2 -0
  30. package/dist/node/index.d.ts.map +1 -0
  31. package/dist/node/index.js +23 -0
  32. package/dist/node/index.js.map +1 -0
  33. package/dist/node/index.mjs +2 -0
  34. package/dist/node/index.mjs.map +1 -0
  35. package/dist/node/lib/difference.d.mts +2 -0
  36. package/dist/node/lib/difference.d.mts.map +1 -0
  37. package/dist/node/lib/difference.d.ts +2 -0
  38. package/dist/node/lib/difference.d.ts.map +1 -0
  39. package/dist/node/lib/difference.js +31 -0
  40. package/dist/node/lib/difference.js.map +1 -0
  41. package/dist/node/lib/difference.mjs +7 -0
  42. package/dist/node/lib/difference.mjs.map +1 -0
  43. package/dist/node/lib/index.d.mts +4 -0
  44. package/dist/node/lib/index.d.mts.map +1 -0
  45. package/dist/node/lib/index.d.ts +4 -0
  46. package/dist/node/lib/index.d.ts.map +1 -0
  47. package/dist/node/lib/index.js +27 -0
  48. package/dist/node/lib/index.js.map +1 -0
  49. package/dist/node/lib/index.mjs +4 -0
  50. package/dist/node/lib/index.mjs.map +1 -0
  51. package/dist/node/lib/intersection.d.mts +2 -0
  52. package/dist/node/lib/intersection.d.mts.map +1 -0
  53. package/dist/node/lib/intersection.d.ts +2 -0
  54. package/dist/node/lib/intersection.d.ts.map +1 -0
  55. package/dist/node/lib/intersection.js +31 -0
  56. package/dist/node/lib/intersection.js.map +1 -0
  57. package/dist/node/lib/intersection.mjs +7 -0
  58. package/dist/node/lib/intersection.mjs.map +1 -0
  59. package/dist/node/lib/spec/difference.spec.js +15 -0
  60. package/dist/node/lib/spec/difference.spec.js.map +1 -0
  61. package/dist/node/lib/spec/difference.spec.mjs +14 -0
  62. package/dist/node/lib/spec/difference.spec.mjs.map +1 -0
  63. package/dist/node/lib/spec/intersection.spec.js +15 -0
  64. package/dist/node/lib/spec/intersection.spec.js.map +1 -0
  65. package/dist/node/lib/spec/intersection.spec.mjs +14 -0
  66. package/dist/node/lib/spec/intersection.spec.mjs.map +1 -0
  67. package/dist/node/lib/spec/union.spec.js +15 -0
  68. package/dist/node/lib/spec/union.spec.js.map +1 -0
  69. package/dist/node/lib/spec/union.spec.mjs +14 -0
  70. package/dist/node/lib/spec/union.spec.mjs.map +1 -0
  71. package/dist/node/lib/union.d.mts +2 -0
  72. package/dist/node/lib/union.d.mts.map +1 -0
  73. package/dist/node/lib/union.d.ts +2 -0
  74. package/dist/node/lib/union.d.ts.map +1 -0
  75. package/dist/{index.js → node/lib/union.js} +5 -23
  76. package/dist/node/lib/union.js.map +1 -0
  77. package/dist/node/lib/union.mjs +7 -0
  78. package/dist/node/lib/union.mjs.map +1 -0
  79. package/package.json +10 -19
  80. package/dist/index.js.map +0 -1
  81. package/dist/index.mjs +0 -20
  82. package/dist/index.mjs.map +0 -1
  83. package/dist/lib/difference.d.mts.map +0 -1
  84. package/dist/lib/difference.d.ts.map +0 -1
  85. package/dist/lib/index.d.mts.map +0 -1
  86. package/dist/lib/index.d.ts.map +0 -1
  87. package/dist/lib/intersection.d.mts.map +0 -1
  88. package/dist/lib/intersection.d.ts.map +0 -1
  89. package/dist/lib/union.d.mts.map +0 -1
  90. package/dist/lib/union.d.ts.map +0 -1
  91. /package/dist/{index.d.mts → browser/index.d.mts} +0 -0
  92. /package/dist/{index.d.ts → browser/index.d.ts} +0 -0
  93. /package/dist/{lib → browser/lib}/difference.d.mts +0 -0
  94. /package/dist/{lib → browser/lib}/difference.d.ts +0 -0
  95. /package/dist/{lib → browser/lib}/index.d.mts +0 -0
  96. /package/dist/{lib → browser/lib}/index.d.ts +0 -0
  97. /package/dist/{lib → browser/lib}/intersection.d.mts +0 -0
  98. /package/dist/{lib → browser/lib}/intersection.d.ts +0 -0
  99. /package/dist/{lib → browser/lib}/union.d.mts +0 -0
  100. /package/dist/{lib → browser/lib}/union.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from "./lib";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './lib'\n"],"mappings":"AAAA,cAAc;","names":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../../src/lib/difference.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,iDAEtB,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../../src/lib/difference.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,iDAEtB,CAAA"}
@@ -0,0 +1,7 @@
1
+ const difference = (a, b) => {
2
+ return new Set(Array.from(a).filter((x) => !b.has(x)));
3
+ };
4
+ export {
5
+ difference
6
+ };
7
+ //# sourceMappingURL=difference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/difference.ts"],"sourcesContent":["export const difference = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set(Array.from(a).filter((x) => !b.has(x)))\n}\n"],"mappings":"AAAO,MAAM,aAAa,CAAO,GAAc,MAA4B;AACzE,SAAO,IAAI,IAAI,MAAM,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACvD;","names":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from "./difference";
2
+ export * from "./intersection";
3
+ export * from "./union";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/index.ts"],"sourcesContent":["export * from './difference'\nexport * from './intersection'\nexport * from './union'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intersection.d.ts","sourceRoot":"","sources":["../../../src/lib/intersection.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,iDAExB,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intersection.d.ts","sourceRoot":"","sources":["../../../src/lib/intersection.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,iDAExB,CAAA"}
@@ -0,0 +1,7 @@
1
+ const intersection = (a, b) => {
2
+ return new Set(Array.from(a).filter((x) => b.has(x)));
3
+ };
4
+ export {
5
+ intersection
6
+ };
7
+ //# sourceMappingURL=intersection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/intersection.ts"],"sourcesContent":["export const intersection = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set(Array.from(a).filter((x) => b.has(x)))\n}\n"],"mappings":"AAAO,MAAM,eAAe,CAAO,GAAc,MAA4B;AAC3E,SAAO,IAAI,IAAI,MAAM,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACtD;","names":[]}
@@ -0,0 +1,14 @@
1
+ import { difference } from "../difference";
2
+ const cases = [
3
+ // Difference is non-commutative
4
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([2, 3, 4]), /* @__PURE__ */ new Set([1])],
5
+ [/* @__PURE__ */ new Set([2, 3, 4]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([4])],
6
+ // Difference of identical sets yields empty set
7
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([])]
8
+ ];
9
+ describe("difference", () => {
10
+ test.each(cases)("calculates the difference of the two sets", (a, b, expected) => {
11
+ expect(difference(a, b)).toEqual(expected);
12
+ });
13
+ });
14
+ //# sourceMappingURL=difference.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/spec/difference.spec.ts"],"sourcesContent":["import { difference } from '../difference'\n\nconst cases = [\n // Difference is non-commutative\n [new Set([1, 2, 3]), new Set([2, 3, 4]), new Set([1])],\n [new Set([2, 3, 4]), new Set([1, 2, 3]), new Set([4])],\n // Difference of identical sets yields empty set\n [new Set([1, 2, 3]), new Set([1, 2, 3]), new Set([])],\n]\n\ndescribe('difference', () => {\n test.each(cases)('calculates the difference of the two sets', (a, b, expected) => {\n expect(difference(a, b)).toEqual(expected)\n })\n})\n"],"mappings":"AAAA,SAAS,kBAAkB;AAE3B,MAAM,QAAQ;AAAA;AAAA,EAEZ,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AAAA,EACrD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AAAA;AAAA,EAErD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,CAAC,CAAC;AACtD;AAEA,SAAS,cAAc,MAAM;AAC3B,OAAK,KAAK,KAAK,EAAE,6CAA6C,CAAC,GAAG,GAAG,aAAa;AAChF,WAAO,WAAW,GAAG,CAAC,CAAC,EAAE,QAAQ,QAAQ;AAAA,EAC3C,CAAC;AACH,CAAC;","names":[]}
@@ -0,0 +1,14 @@
1
+ import { intersection } from "../intersection";
2
+ const cases = [
3
+ // Intersection is commutative
4
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([2, 3, 4]), /* @__PURE__ */ new Set([2, 3])],
5
+ [/* @__PURE__ */ new Set([2, 3, 4]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([2, 3])],
6
+ // Intersection of identical sets yields same set
7
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3])]
8
+ ];
9
+ describe("intersection", () => {
10
+ test.each(cases)("calculates the intersection of the two sets", (a, b, expected) => {
11
+ expect(intersection(a, b)).toEqual(expected);
12
+ });
13
+ });
14
+ //# sourceMappingURL=intersection.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/spec/intersection.spec.ts"],"sourcesContent":["import { intersection } from '../intersection'\n\nconst cases = [\n // Intersection is commutative\n [new Set([1, 2, 3]), new Set([2, 3, 4]), new Set([2, 3])],\n [new Set([2, 3, 4]), new Set([1, 2, 3]), new Set([2, 3])],\n // Intersection of identical sets yields same set\n [new Set([1, 2, 3]), new Set([1, 2, 3]), new Set([1, 2, 3])],\n]\n\ndescribe('intersection', () => {\n test.each(cases)('calculates the intersection of the two sets', (a, b, expected) => {\n expect(intersection(a, b)).toEqual(expected)\n })\n})\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,MAAM,QAAQ;AAAA;AAAA,EAEZ,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAAA,EACxD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAAA;AAAA,EAExD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAC7D;AAEA,SAAS,gBAAgB,MAAM;AAC7B,OAAK,KAAK,KAAK,EAAE,+CAA+C,CAAC,GAAG,GAAG,aAAa;AAClF,WAAO,aAAa,GAAG,CAAC,CAAC,EAAE,QAAQ,QAAQ;AAAA,EAC7C,CAAC;AACH,CAAC;","names":[]}
@@ -0,0 +1,14 @@
1
+ import { union } from "../union";
2
+ const cases = [
3
+ // Union is commutative
4
+ [/* @__PURE__ */ new Set([1, 2]), /* @__PURE__ */ new Set([3, 4]), /* @__PURE__ */ new Set([1, 2, 3, 4])],
5
+ [/* @__PURE__ */ new Set([3, 4]), /* @__PURE__ */ new Set([1, 2]), /* @__PURE__ */ new Set([1, 2, 3, 4])],
6
+ // Union of identical sets yields same set
7
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3])]
8
+ ];
9
+ describe("union", () => {
10
+ test.each(cases)("calculates the union of the two sets", (a, b, expected) => {
11
+ expect(union(a, b)).toEqual(expected);
12
+ });
13
+ });
14
+ //# sourceMappingURL=union.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/spec/union.spec.ts"],"sourcesContent":["import { union } from '../union'\n\nconst cases = [\n // Union is commutative\n [new Set([1, 2]), new Set([3, 4]), new Set([1, 2, 3, 4])],\n [new Set([3, 4]), new Set([1, 2]), new Set([1, 2, 3, 4])],\n // Union of identical sets yields same set\n [new Set([1, 2, 3]), new Set([1, 2, 3]), new Set([1, 2, 3])],\n]\n\ndescribe('union', () => {\n test.each(cases)('calculates the union of the two sets', (a, b, expected) => {\n expect(union(a, b)).toEqual(expected)\n })\n})\n"],"mappings":"AAAA,SAAS,aAAa;AAEtB,MAAM,QAAQ;AAAA;AAAA,EAEZ,CAAC,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;AAAA,EACxD,CAAC,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;AAAA;AAAA,EAExD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAC7D;AAEA,SAAS,SAAS,MAAM;AACtB,OAAK,KAAK,KAAK,EAAE,wCAAwC,CAAC,GAAG,GAAG,aAAa;AAC3E,WAAO,MAAM,GAAG,CAAC,CAAC,EAAE,QAAQ,QAAQ;AAAA,EACtC,CAAC;AACH,CAAC;","names":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../../src/lib/union.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,iDAEjB,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../../src/lib/union.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,iDAEjB,CAAA"}
@@ -0,0 +1,7 @@
1
+ const union = (a, b) => {
2
+ return /* @__PURE__ */ new Set([...a, ...b]);
3
+ };
4
+ export {
5
+ union
6
+ };
7
+ //# sourceMappingURL=union.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/union.ts"],"sourcesContent":["export const union = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set([...a, ...b])\n}\n"],"mappings":"AAAO,MAAM,QAAQ,CAAO,GAAc,MAA4B;AACpE,SAAO,oBAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;AAC7B;","names":[]}
@@ -0,0 +1,2 @@
1
+ export * from './lib';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './lib';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var src_exports = {};
17
+ module.exports = __toCommonJS(src_exports);
18
+ __reExport(src_exports, require("./lib"), module.exports);
19
+ // Annotate the CommonJS export names for ESM import in node:
20
+ 0 && (module.exports = {
21
+ ...require("./lib")
22
+ });
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './lib'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,kBAAd;","names":[]}
@@ -0,0 +1,2 @@
1
+ export * from "./lib";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from './lib'\n"],"mappings":"AAAA,cAAc;","names":[]}
@@ -0,0 +1,2 @@
1
+ export declare const difference: <TKey>(a: Set<TKey>, b: Set<TKey>) => Set<TKey>;
2
+ //# sourceMappingURL=difference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../../src/lib/difference.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,iDAEtB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const difference: <TKey>(a: Set<TKey>, b: Set<TKey>) => Set<TKey>;
2
+ //# sourceMappingURL=difference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../../src/lib/difference.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,iDAEtB,CAAA"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var difference_exports = {};
20
+ __export(difference_exports, {
21
+ difference: () => difference
22
+ });
23
+ module.exports = __toCommonJS(difference_exports);
24
+ const difference = (a, b) => {
25
+ return new Set(Array.from(a).filter((x) => !b.has(x)));
26
+ };
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ difference
30
+ });
31
+ //# sourceMappingURL=difference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/difference.ts"],"sourcesContent":["export const difference = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set(Array.from(a).filter((x) => !b.has(x)))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,aAAa,CAAO,GAAc,MAA4B;AACzE,SAAO,IAAI,IAAI,MAAM,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACvD;","names":[]}
@@ -0,0 +1,7 @@
1
+ const difference = (a, b) => {
2
+ return new Set(Array.from(a).filter((x) => !b.has(x)));
3
+ };
4
+ export {
5
+ difference
6
+ };
7
+ //# sourceMappingURL=difference.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/difference.ts"],"sourcesContent":["export const difference = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set(Array.from(a).filter((x) => !b.has(x)))\n}\n"],"mappings":"AAAO,MAAM,aAAa,CAAO,GAAc,MAA4B;AACzE,SAAO,IAAI,IAAI,MAAM,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACvD;","names":[]}
@@ -0,0 +1,4 @@
1
+ export * from './difference';
2
+ export * from './intersection';
3
+ export * from './union';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA"}
@@ -0,0 +1,4 @@
1
+ export * from './difference';
2
+ export * from './intersection';
3
+ export * from './union';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var lib_exports = {};
17
+ module.exports = __toCommonJS(lib_exports);
18
+ __reExport(lib_exports, require("./difference"), module.exports);
19
+ __reExport(lib_exports, require("./intersection"), module.exports);
20
+ __reExport(lib_exports, require("./union"), module.exports);
21
+ // Annotate the CommonJS export names for ESM import in node:
22
+ 0 && (module.exports = {
23
+ ...require("./difference"),
24
+ ...require("./intersection"),
25
+ ...require("./union")
26
+ });
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/index.ts"],"sourcesContent":["export * from './difference'\nexport * from './intersection'\nexport * from './union'\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,yBAAd;AACA,wBAAc,2BADd;AAEA,wBAAc,oBAFd;","names":[]}
@@ -0,0 +1,4 @@
1
+ export * from "./difference";
2
+ export * from "./intersection";
3
+ export * from "./union";
4
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/index.ts"],"sourcesContent":["export * from './difference'\nexport * from './intersection'\nexport * from './union'\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}
@@ -0,0 +1,2 @@
1
+ export declare const intersection: <TKey>(a: Set<TKey>, b: Set<TKey>) => Set<TKey>;
2
+ //# sourceMappingURL=intersection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intersection.d.ts","sourceRoot":"","sources":["../../../src/lib/intersection.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,iDAExB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const intersection: <TKey>(a: Set<TKey>, b: Set<TKey>) => Set<TKey>;
2
+ //# sourceMappingURL=intersection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intersection.d.ts","sourceRoot":"","sources":["../../../src/lib/intersection.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,iDAExB,CAAA"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var intersection_exports = {};
20
+ __export(intersection_exports, {
21
+ intersection: () => intersection
22
+ });
23
+ module.exports = __toCommonJS(intersection_exports);
24
+ const intersection = (a, b) => {
25
+ return new Set(Array.from(a).filter((x) => b.has(x)));
26
+ };
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ intersection
30
+ });
31
+ //# sourceMappingURL=intersection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/intersection.ts"],"sourcesContent":["export const intersection = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set(Array.from(a).filter((x) => b.has(x)))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,eAAe,CAAO,GAAc,MAA4B;AAC3E,SAAO,IAAI,IAAI,MAAM,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACtD;","names":[]}
@@ -0,0 +1,7 @@
1
+ const intersection = (a, b) => {
2
+ return new Set(Array.from(a).filter((x) => b.has(x)));
3
+ };
4
+ export {
5
+ intersection
6
+ };
7
+ //# sourceMappingURL=intersection.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/intersection.ts"],"sourcesContent":["export const intersection = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set(Array.from(a).filter((x) => b.has(x)))\n}\n"],"mappings":"AAAO,MAAM,eAAe,CAAO,GAAc,MAA4B;AAC3E,SAAO,IAAI,IAAI,MAAM,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACtD;","names":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var import_difference = require("../difference");
3
+ const cases = [
4
+ // Difference is non-commutative
5
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([2, 3, 4]), /* @__PURE__ */ new Set([1])],
6
+ [/* @__PURE__ */ new Set([2, 3, 4]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([4])],
7
+ // Difference of identical sets yields empty set
8
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([])]
9
+ ];
10
+ describe("difference", () => {
11
+ test.each(cases)("calculates the difference of the two sets", (a, b, expected) => {
12
+ expect((0, import_difference.difference)(a, b)).toEqual(expected);
13
+ });
14
+ });
15
+ //# sourceMappingURL=difference.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/spec/difference.spec.ts"],"sourcesContent":["import { difference } from '../difference'\n\nconst cases = [\n // Difference is non-commutative\n [new Set([1, 2, 3]), new Set([2, 3, 4]), new Set([1])],\n [new Set([2, 3, 4]), new Set([1, 2, 3]), new Set([4])],\n // Difference of identical sets yields empty set\n [new Set([1, 2, 3]), new Set([1, 2, 3]), new Set([])],\n]\n\ndescribe('difference', () => {\n test.each(cases)('calculates the difference of the two sets', (a, b, expected) => {\n expect(difference(a, b)).toEqual(expected)\n })\n})\n"],"mappings":";AAAA,wBAA2B;AAE3B,MAAM,QAAQ;AAAA;AAAA,EAEZ,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AAAA,EACrD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AAAA;AAAA,EAErD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,CAAC,CAAC;AACtD;AAEA,SAAS,cAAc,MAAM;AAC3B,OAAK,KAAK,KAAK,EAAE,6CAA6C,CAAC,GAAG,GAAG,aAAa;AAChF,eAAO,8BAAW,GAAG,CAAC,CAAC,EAAE,QAAQ,QAAQ;AAAA,EAC3C,CAAC;AACH,CAAC;","names":[]}
@@ -0,0 +1,14 @@
1
+ import { difference } from "../difference";
2
+ const cases = [
3
+ // Difference is non-commutative
4
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([2, 3, 4]), /* @__PURE__ */ new Set([1])],
5
+ [/* @__PURE__ */ new Set([2, 3, 4]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([4])],
6
+ // Difference of identical sets yields empty set
7
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([])]
8
+ ];
9
+ describe("difference", () => {
10
+ test.each(cases)("calculates the difference of the two sets", (a, b, expected) => {
11
+ expect(difference(a, b)).toEqual(expected);
12
+ });
13
+ });
14
+ //# sourceMappingURL=difference.spec.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/spec/difference.spec.ts"],"sourcesContent":["import { difference } from '../difference'\n\nconst cases = [\n // Difference is non-commutative\n [new Set([1, 2, 3]), new Set([2, 3, 4]), new Set([1])],\n [new Set([2, 3, 4]), new Set([1, 2, 3]), new Set([4])],\n // Difference of identical sets yields empty set\n [new Set([1, 2, 3]), new Set([1, 2, 3]), new Set([])],\n]\n\ndescribe('difference', () => {\n test.each(cases)('calculates the difference of the two sets', (a, b, expected) => {\n expect(difference(a, b)).toEqual(expected)\n })\n})\n"],"mappings":"AAAA,SAAS,kBAAkB;AAE3B,MAAM,QAAQ;AAAA;AAAA,EAEZ,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AAAA,EACrD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,CAAC,CAAC,CAAC;AAAA;AAAA,EAErD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,CAAC,CAAC;AACtD;AAEA,SAAS,cAAc,MAAM;AAC3B,OAAK,KAAK,KAAK,EAAE,6CAA6C,CAAC,GAAG,GAAG,aAAa;AAChF,WAAO,WAAW,GAAG,CAAC,CAAC,EAAE,QAAQ,QAAQ;AAAA,EAC3C,CAAC;AACH,CAAC;","names":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var import_intersection = require("../intersection");
3
+ const cases = [
4
+ // Intersection is commutative
5
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([2, 3, 4]), /* @__PURE__ */ new Set([2, 3])],
6
+ [/* @__PURE__ */ new Set([2, 3, 4]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([2, 3])],
7
+ // Intersection of identical sets yields same set
8
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3])]
9
+ ];
10
+ describe("intersection", () => {
11
+ test.each(cases)("calculates the intersection of the two sets", (a, b, expected) => {
12
+ expect((0, import_intersection.intersection)(a, b)).toEqual(expected);
13
+ });
14
+ });
15
+ //# sourceMappingURL=intersection.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/spec/intersection.spec.ts"],"sourcesContent":["import { intersection } from '../intersection'\n\nconst cases = [\n // Intersection is commutative\n [new Set([1, 2, 3]), new Set([2, 3, 4]), new Set([2, 3])],\n [new Set([2, 3, 4]), new Set([1, 2, 3]), new Set([2, 3])],\n // Intersection of identical sets yields same set\n [new Set([1, 2, 3]), new Set([1, 2, 3]), new Set([1, 2, 3])],\n]\n\ndescribe('intersection', () => {\n test.each(cases)('calculates the intersection of the two sets', (a, b, expected) => {\n expect(intersection(a, b)).toEqual(expected)\n })\n})\n"],"mappings":";AAAA,0BAA6B;AAE7B,MAAM,QAAQ;AAAA;AAAA,EAEZ,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAAA,EACxD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAAA;AAAA,EAExD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAC7D;AAEA,SAAS,gBAAgB,MAAM;AAC7B,OAAK,KAAK,KAAK,EAAE,+CAA+C,CAAC,GAAG,GAAG,aAAa;AAClF,eAAO,kCAAa,GAAG,CAAC,CAAC,EAAE,QAAQ,QAAQ;AAAA,EAC7C,CAAC;AACH,CAAC;","names":[]}
@@ -0,0 +1,14 @@
1
+ import { intersection } from "../intersection";
2
+ const cases = [
3
+ // Intersection is commutative
4
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([2, 3, 4]), /* @__PURE__ */ new Set([2, 3])],
5
+ [/* @__PURE__ */ new Set([2, 3, 4]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([2, 3])],
6
+ // Intersection of identical sets yields same set
7
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3])]
8
+ ];
9
+ describe("intersection", () => {
10
+ test.each(cases)("calculates the intersection of the two sets", (a, b, expected) => {
11
+ expect(intersection(a, b)).toEqual(expected);
12
+ });
13
+ });
14
+ //# sourceMappingURL=intersection.spec.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/spec/intersection.spec.ts"],"sourcesContent":["import { intersection } from '../intersection'\n\nconst cases = [\n // Intersection is commutative\n [new Set([1, 2, 3]), new Set([2, 3, 4]), new Set([2, 3])],\n [new Set([2, 3, 4]), new Set([1, 2, 3]), new Set([2, 3])],\n // Intersection of identical sets yields same set\n [new Set([1, 2, 3]), new Set([1, 2, 3]), new Set([1, 2, 3])],\n]\n\ndescribe('intersection', () => {\n test.each(cases)('calculates the intersection of the two sets', (a, b, expected) => {\n expect(intersection(a, b)).toEqual(expected)\n })\n})\n"],"mappings":"AAAA,SAAS,oBAAoB;AAE7B,MAAM,QAAQ;AAAA;AAAA,EAEZ,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAAA,EACxD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAAA;AAAA,EAExD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAC7D;AAEA,SAAS,gBAAgB,MAAM;AAC7B,OAAK,KAAK,KAAK,EAAE,+CAA+C,CAAC,GAAG,GAAG,aAAa;AAClF,WAAO,aAAa,GAAG,CAAC,CAAC,EAAE,QAAQ,QAAQ;AAAA,EAC7C,CAAC;AACH,CAAC;","names":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var import_union = require("../union");
3
+ const cases = [
4
+ // Union is commutative
5
+ [/* @__PURE__ */ new Set([1, 2]), /* @__PURE__ */ new Set([3, 4]), /* @__PURE__ */ new Set([1, 2, 3, 4])],
6
+ [/* @__PURE__ */ new Set([3, 4]), /* @__PURE__ */ new Set([1, 2]), /* @__PURE__ */ new Set([1, 2, 3, 4])],
7
+ // Union of identical sets yields same set
8
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3])]
9
+ ];
10
+ describe("union", () => {
11
+ test.each(cases)("calculates the union of the two sets", (a, b, expected) => {
12
+ expect((0, import_union.union)(a, b)).toEqual(expected);
13
+ });
14
+ });
15
+ //# sourceMappingURL=union.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/spec/union.spec.ts"],"sourcesContent":["import { union } from '../union'\n\nconst cases = [\n // Union is commutative\n [new Set([1, 2]), new Set([3, 4]), new Set([1, 2, 3, 4])],\n [new Set([3, 4]), new Set([1, 2]), new Set([1, 2, 3, 4])],\n // Union of identical sets yields same set\n [new Set([1, 2, 3]), new Set([1, 2, 3]), new Set([1, 2, 3])],\n]\n\ndescribe('union', () => {\n test.each(cases)('calculates the union of the two sets', (a, b, expected) => {\n expect(union(a, b)).toEqual(expected)\n })\n})\n"],"mappings":";AAAA,mBAAsB;AAEtB,MAAM,QAAQ;AAAA;AAAA,EAEZ,CAAC,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;AAAA,EACxD,CAAC,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;AAAA;AAAA,EAExD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAC7D;AAEA,SAAS,SAAS,MAAM;AACtB,OAAK,KAAK,KAAK,EAAE,wCAAwC,CAAC,GAAG,GAAG,aAAa;AAC3E,eAAO,oBAAM,GAAG,CAAC,CAAC,EAAE,QAAQ,QAAQ;AAAA,EACtC,CAAC;AACH,CAAC;","names":[]}
@@ -0,0 +1,14 @@
1
+ import { union } from "../union";
2
+ const cases = [
3
+ // Union is commutative
4
+ [/* @__PURE__ */ new Set([1, 2]), /* @__PURE__ */ new Set([3, 4]), /* @__PURE__ */ new Set([1, 2, 3, 4])],
5
+ [/* @__PURE__ */ new Set([3, 4]), /* @__PURE__ */ new Set([1, 2]), /* @__PURE__ */ new Set([1, 2, 3, 4])],
6
+ // Union of identical sets yields same set
7
+ [/* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3]), /* @__PURE__ */ new Set([1, 2, 3])]
8
+ ];
9
+ describe("union", () => {
10
+ test.each(cases)("calculates the union of the two sets", (a, b, expected) => {
11
+ expect(union(a, b)).toEqual(expected);
12
+ });
13
+ });
14
+ //# sourceMappingURL=union.spec.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/lib/spec/union.spec.ts"],"sourcesContent":["import { union } from '../union'\n\nconst cases = [\n // Union is commutative\n [new Set([1, 2]), new Set([3, 4]), new Set([1, 2, 3, 4])],\n [new Set([3, 4]), new Set([1, 2]), new Set([1, 2, 3, 4])],\n // Union of identical sets yields same set\n [new Set([1, 2, 3]), new Set([1, 2, 3]), new Set([1, 2, 3])],\n]\n\ndescribe('union', () => {\n test.each(cases)('calculates the union of the two sets', (a, b, expected) => {\n expect(union(a, b)).toEqual(expected)\n })\n})\n"],"mappings":"AAAA,SAAS,aAAa;AAEtB,MAAM,QAAQ;AAAA;AAAA,EAEZ,CAAC,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;AAAA,EACxD,CAAC,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;AAAA;AAAA,EAExD,CAAC,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAC7D;AAEA,SAAS,SAAS,MAAM;AACtB,OAAK,KAAK,KAAK,EAAE,wCAAwC,CAAC,GAAG,GAAG,aAAa;AAC3E,WAAO,MAAM,GAAG,CAAC,CAAC,EAAE,QAAQ,QAAQ;AAAA,EACtC,CAAC;AACH,CAAC;","names":[]}
@@ -0,0 +1,2 @@
1
+ export declare const union: <TKey>(a: Set<TKey>, b: Set<TKey>) => Set<TKey>;
2
+ //# sourceMappingURL=union.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../../src/lib/union.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,iDAEjB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const union: <TKey>(a: Set<TKey>, b: Set<TKey>) => Set<TKey>;
2
+ //# sourceMappingURL=union.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../../src/lib/union.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,iDAEjB,CAAA"}
@@ -16,34 +16,16 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- difference: () => difference,
24
- intersection: () => intersection,
19
+ var union_exports = {};
20
+ __export(union_exports, {
25
21
  union: () => union
26
22
  });
27
- module.exports = __toCommonJS(src_exports);
28
-
29
- // src/lib/difference.ts
30
- var difference = (a, b) => {
31
- return new Set(Array.from(a).filter((x) => !b.has(x)));
32
- };
33
-
34
- // src/lib/intersection.ts
35
- var intersection = (a, b) => {
36
- return new Set(Array.from(a).filter((x) => b.has(x)));
37
- };
38
-
39
- // src/lib/union.ts
40
- var union = (a, b) => {
23
+ module.exports = __toCommonJS(union_exports);
24
+ const union = (a, b) => {
41
25
  return /* @__PURE__ */ new Set([...a, ...b]);
42
26
  };
43
27
  // Annotate the CommonJS export names for ESM import in node:
44
28
  0 && (module.exports = {
45
- difference,
46
- intersection,
47
29
  union
48
30
  });
49
- //# sourceMappingURL=index.js.map
31
+ //# sourceMappingURL=union.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/union.ts"],"sourcesContent":["export const union = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set([...a, ...b])\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,QAAQ,CAAO,GAAc,MAA4B;AACpE,SAAO,oBAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;AAC7B;","names":[]}
@@ -0,0 +1,7 @@
1
+ const union = (a, b) => {
2
+ return /* @__PURE__ */ new Set([...a, ...b]);
3
+ };
4
+ export {
5
+ union
6
+ };
7
+ //# sourceMappingURL=union.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/lib/union.ts"],"sourcesContent":["export const union = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set([...a, ...b])\n}\n"],"mappings":"AAAO,MAAM,QAAQ,CAAO,GAAc,MAA4B;AACpE,SAAO,oBAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;AAC7B;","names":[]}
package/package.json CHANGED
@@ -15,34 +15,25 @@
15
15
  ],
16
16
  "description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
17
17
  "docs": "dist/docs.json",
18
- "types": "dist/index.d.ts",
18
+ "types": "dist/node/index.d.ts",
19
19
  "exports": {
20
20
  ".": {
21
21
  "require": {
22
- "types": "./dist/index.d.ts",
23
- "default": "./dist/index.js"
22
+ "types": "./dist/node/index.d.ts",
23
+ "default": "./dist/node/index.js"
24
24
  },
25
25
  "import": {
26
- "types": "./dist/index.d.mts",
27
- "default": "./dist/index.mjs"
26
+ "types": "./dist/node/index.d.mts",
27
+ "default": "./dist/node/index.mjs"
28
28
  }
29
29
  },
30
- "./dist/docs.json": {
31
- "default": "./dist/docs.json"
32
- },
33
- "./cjs": {
34
- "default": "./dist/index.js"
35
- },
36
30
  "./docs": {
37
31
  "default": "./dist/docs.json"
38
32
  },
39
- "./esm": {
40
- "default": "./dist/index.mjs"
41
- },
42
33
  "./package.json": "./package.json"
43
34
  },
44
- "main": "dist/index.js",
45
- "module": "dist/index.mjs",
35
+ "main": "dist/node/index.js",
36
+ "module": "dist/node/index.mjs",
46
37
  "homepage": "https://xylabs.com",
47
38
  "keywords": [
48
39
  "xylabs",
@@ -51,8 +42,8 @@
51
42
  "esm"
52
43
  ],
53
44
  "devDependencies": {
54
- "@xylabs/ts-scripts-yarn3": "^3.0.28",
55
- "@xylabs/tsconfig": "^3.0.28",
45
+ "@xylabs/ts-scripts-yarn3": "^3.0.55",
46
+ "@xylabs/tsconfig": "^3.0.55",
56
47
  "typescript": "^5.2.2"
57
48
  },
58
49
  "publishConfig": {
@@ -63,6 +54,6 @@
63
54
  "url": "https://github.com/xylabs/sdk-js.git"
64
55
  },
65
56
  "sideEffects": false,
66
- "version": "2.11.7",
57
+ "version": "2.11.9",
67
58
  "packageManager": "yarn@3.3.1"
68
59
  }
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts","../src/lib/difference.ts","../src/lib/intersection.ts","../src/lib/union.ts"],"sourcesContent":["export * from './lib'\n","export const difference = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set(Array.from(a).filter((x) => !b.has(x)))\n}\n","export const intersection = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set(Array.from(a).filter((x) => b.has(x)))\n}\n","export const union = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set([...a, ...b])\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,aAAa,CAAO,GAAc,MAA4B;AACzE,SAAO,IAAI,IAAI,MAAM,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACvD;;;ACFO,IAAM,eAAe,CAAO,GAAc,MAA4B;AAC3E,SAAO,IAAI,IAAI,MAAM,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACtD;;;ACFO,IAAM,QAAQ,CAAO,GAAc,MAA4B;AACpE,SAAO,oBAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;AAC7B;","names":[]}
package/dist/index.mjs DELETED
@@ -1,20 +0,0 @@
1
- // src/lib/difference.ts
2
- var difference = (a, b) => {
3
- return new Set(Array.from(a).filter((x) => !b.has(x)));
4
- };
5
-
6
- // src/lib/intersection.ts
7
- var intersection = (a, b) => {
8
- return new Set(Array.from(a).filter((x) => b.has(x)));
9
- };
10
-
11
- // src/lib/union.ts
12
- var union = (a, b) => {
13
- return /* @__PURE__ */ new Set([...a, ...b]);
14
- };
15
- export {
16
- difference,
17
- intersection,
18
- union
19
- };
20
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/difference.ts","../src/lib/intersection.ts","../src/lib/union.ts"],"sourcesContent":["export const difference = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set(Array.from(a).filter((x) => !b.has(x)))\n}\n","export const intersection = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set(Array.from(a).filter((x) => b.has(x)))\n}\n","export const union = <TKey>(a: Set<TKey>, b: Set<TKey>): Set<TKey> => {\n return new Set([...a, ...b])\n}\n"],"mappings":";AAAO,IAAM,aAAa,CAAO,GAAc,MAA4B;AACzE,SAAO,IAAI,IAAI,MAAM,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AACvD;;;ACFO,IAAM,eAAe,CAAO,GAAc,MAA4B;AAC3E,SAAO,IAAI,IAAI,MAAM,KAAK,CAAC,EAAE,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;AACtD;;;ACFO,IAAM,QAAQ,CAAO,GAAc,MAA4B;AACpE,SAAO,oBAAI,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;AAC7B;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../src/lib/difference.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,iDAEtB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"difference.d.ts","sourceRoot":"","sources":["../../src/lib/difference.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,iDAEtB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"intersection.d.ts","sourceRoot":"","sources":["../../src/lib/intersection.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,iDAExB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"intersection.d.ts","sourceRoot":"","sources":["../../src/lib/intersection.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,iDAExB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../src/lib/union.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,iDAEjB,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../src/lib/union.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,KAAK,iDAEjB,CAAA"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes