@monstermann/set 0.0.0 → 0.1.1

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 (74) hide show
  1. package/dist/Set/{add.d.ts → add.d.mts} +2 -0
  2. package/dist/Set/{add.js → add.mjs} +2 -0
  3. package/dist/Set/{addAll.d.ts → addAll.d.mts} +2 -0
  4. package/dist/Set/{addAll.js → addAll.mjs} +2 -0
  5. package/dist/Set/{addOr.d.ts → addOr.d.mts} +2 -0
  6. package/dist/Set/{addOr.js → addOr.mjs} +2 -0
  7. package/dist/Set/{addOrElse.d.ts → addOrElse.d.mts} +2 -0
  8. package/dist/Set/{addOrElse.js → addOrElse.mjs} +2 -0
  9. package/dist/Set/{addOrThrow.d.ts → addOrThrow.d.mts} +2 -0
  10. package/dist/Set/{addOrThrow.js → addOrThrow.mjs} +2 -0
  11. package/dist/Set/{clone.d.ts → clone.d.mts} +2 -0
  12. package/dist/Set/{clone.js → clone.mjs} +2 -0
  13. package/dist/Set/{compact.d.ts → compact.d.mts} +3 -1
  14. package/dist/Set/{compact.js → compact.mjs} +2 -0
  15. package/dist/Set/create.d.mts +17 -0
  16. package/dist/Set/create.mjs +20 -0
  17. package/dist/Set/{difference.d.ts → difference.d.mts} +2 -0
  18. package/dist/Set/{difference.js → difference.mjs} +2 -0
  19. package/dist/Set/{forEach.d.ts → forEach.d.mts} +2 -0
  20. package/dist/Set/{forEach.js → forEach.mjs} +2 -0
  21. package/dist/Set/{has.d.ts → has.d.mts} +2 -0
  22. package/dist/Set/{has.js → has.mjs} +2 -0
  23. package/dist/Set/{hasAll.d.ts → hasAll.d.mts} +2 -0
  24. package/dist/Set/{hasAll.js → hasAll.mjs} +2 -0
  25. package/dist/Set/{hasAny.d.ts → hasAny.d.mts} +2 -0
  26. package/dist/Set/{hasAny.js → hasAny.mjs} +2 -0
  27. package/dist/Set/{hasNone.d.ts → hasNone.d.mts} +2 -0
  28. package/dist/Set/{hasNone.js → hasNone.mjs} +2 -0
  29. package/dist/Set/index.d.mts +39 -0
  30. package/dist/Set/index.mjs +69 -0
  31. package/dist/Set/{intersection.d.ts → intersection.d.mts} +2 -0
  32. package/dist/Set/{intersection.js → intersection.mjs} +2 -0
  33. package/dist/Set/is.d.mts +30 -0
  34. package/dist/Set/is.mjs +32 -0
  35. package/dist/Set/{isDisjointFrom.d.ts → isDisjointFrom.d.mts} +2 -0
  36. package/dist/Set/{isDisjointFrom.js → isDisjointFrom.mjs} +2 -0
  37. package/dist/Set/{isEmpty.d.ts → isEmpty.d.mts} +2 -0
  38. package/dist/Set/{isEmpty.js → isEmpty.mjs} +2 -0
  39. package/dist/Set/{isShallowEqual.d.ts → isShallowEqual.d.mts} +2 -0
  40. package/dist/Set/{isShallowEqual.js → isShallowEqual.mjs} +2 -0
  41. package/dist/Set/{isSubsetOf.d.ts → isSubsetOf.d.mts} +2 -0
  42. package/dist/Set/{isSubsetOf.js → isSubsetOf.mjs} +2 -0
  43. package/dist/Set/{isSupersetOf.d.ts → isSupersetOf.d.mts} +2 -0
  44. package/dist/Set/{isSupersetOf.js → isSupersetOf.mjs} +2 -0
  45. package/dist/Set/{mapEach.d.ts → mapEach.d.mts} +2 -0
  46. package/dist/Set/{mapEach.js → mapEach.mjs} +2 -0
  47. package/dist/Set/{remove.d.ts → remove.d.mts} +2 -0
  48. package/dist/Set/{remove.js → remove.mjs} +2 -0
  49. package/dist/Set/{removeAll.d.ts → removeAll.d.mts} +2 -0
  50. package/dist/Set/{removeAll.js → removeAll.mjs} +2 -0
  51. package/dist/Set/{removeOr.d.ts → removeOr.d.mts} +2 -0
  52. package/dist/Set/{removeOr.js → removeOr.mjs} +2 -0
  53. package/dist/Set/{removeOrElse.d.ts → removeOrElse.d.mts} +2 -0
  54. package/dist/Set/{removeOrElse.js → removeOrElse.mjs} +2 -0
  55. package/dist/Set/{removeOrThrow.d.ts → removeOrThrow.d.mts} +2 -0
  56. package/dist/Set/{removeOrThrow.js → removeOrThrow.mjs} +2 -0
  57. package/dist/Set/{size.d.ts → size.d.mts} +2 -0
  58. package/dist/Set/{size.js → size.mjs} +2 -0
  59. package/dist/Set/{symmetricDifference.d.ts → symmetricDifference.d.mts} +2 -0
  60. package/dist/Set/{symmetricDifference.js → symmetricDifference.mjs} +2 -0
  61. package/dist/Set/{toArray.d.ts → toArray.d.mts} +2 -0
  62. package/dist/Set/{toArray.js → toArray.mjs} +2 -0
  63. package/dist/Set/{union.d.ts → union.d.mts} +2 -0
  64. package/dist/Set/{union.js → union.mjs} +2 -0
  65. package/dist/index.d.mts +2 -0
  66. package/dist/index.mjs +3 -0
  67. package/package.json +8 -7
  68. package/dist/Set/index.d.ts +0 -38
  69. package/dist/Set/index.js +0 -67
  70. package/dist/Set/isSet.d.ts +0 -28
  71. package/dist/Set/isSet.js +0 -30
  72. package/dist/index.d.ts +0 -2
  73. package/dist/index.js +0 -3
  74. /package/dist/Set/internals/{types.d.ts → types.d.mts} +0 -0
@@ -4,6 +4,8 @@
4
4
  * function Set.add(target, value)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -7,6 +7,8 @@ import { cloneSet } from "@monstermann/remmi";
7
7
  * function Set.add(target, value)
8
8
  * ```
9
9
  *
10
+ * Example
11
+ *
10
12
  * ```ts
11
13
  * import { Set } from "@monstermann/set";
12
14
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.addAll(target, values)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -7,6 +7,8 @@ import { cloneSet } from "@monstermann/remmi";
7
7
  * function Set.addAll(target, values)
8
8
  * ```
9
9
  *
10
+ * Example
11
+ *
10
12
  * ```ts
11
13
  * import { Set } from "@monstermann/set";
12
14
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.addOr(target, value, or)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -7,6 +7,8 @@ import { cloneSet } from "@monstermann/remmi";
7
7
  * function Set.addOr(target, value, or)
8
8
  * ```
9
9
  *
10
+ * Example
11
+ *
10
12
  * ```ts
11
13
  * import { Set } from "@monstermann/set";
12
14
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.addOrElse(target, value, orElse)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -7,6 +7,8 @@ import { cloneSet } from "@monstermann/remmi";
7
7
  * function Set.addOrElse(target, value, orElse)
8
8
  * ```
9
9
  *
10
+ * Example
11
+ *
10
12
  * ```ts
11
13
  * import { Set } from "@monstermann/set";
12
14
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.addOrThrow(target, value)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -7,6 +7,8 @@ import { cloneSet } from "@monstermann/remmi";
7
7
  * function Set.addOrThrow(target, value)
8
8
  * ```
9
9
  *
10
+ * Example
11
+ *
10
12
  * ```ts
11
13
  * import { Set } from "@monstermann/set";
12
14
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.clone(target)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -7,6 +7,8 @@ import { cloneSet } from "@monstermann/remmi";
7
7
  * function Set.clone(target)
8
8
  * ```
9
9
  *
10
+ * Example
11
+ *
10
12
  * ```ts
11
13
  * import { Set } from "@monstermann/set";
12
14
  *
@@ -1,4 +1,4 @@
1
- import { NonNil } from "./internals/types.js";
1
+ import { NonNil } from "./internals/types.mjs";
2
2
 
3
3
  //#region src/Set/compact.d.ts
4
4
 
@@ -7,6 +7,8 @@ import { NonNil } from "./internals/types.js";
7
7
  * function Set.compact(target)
8
8
  * ```
9
9
  *
10
+ * Example
11
+ *
10
12
  * ```ts
11
13
  * import { Set } from "@monstermann/set";
12
14
  *
@@ -7,6 +7,8 @@ import { cloneSet } from "@monstermann/remmi";
7
7
  * function Set.compact(target)
8
8
  * ```
9
9
  *
10
+ * Example
11
+ *
10
12
  * ```ts
11
13
  * import { Set } from "@monstermann/set";
12
14
  *
@@ -0,0 +1,17 @@
1
+ //#region src/Set/create.d.ts
2
+ /**
3
+ * ```ts
4
+ * function Set.create(iterable?)
5
+ * ```
6
+ *
7
+ * Example
8
+ *
9
+ * ```ts
10
+ * import { Set } from "@monstermann/set";
11
+ *
12
+ * Set.create([1, 2, 3]); // Set([1, 2, 3])
13
+ * ```
14
+ */
15
+ declare function create<T>(iterable?: Iterable<T> | null | undefined): Set<T>;
16
+ //#endregion
17
+ export { create };
@@ -0,0 +1,20 @@
1
+ //#region src/Set/create.ts
2
+ /**
3
+ * ```ts
4
+ * function Set.create(iterable?)
5
+ * ```
6
+ *
7
+ * Example
8
+ *
9
+ * ```ts
10
+ * import { Set } from "@monstermann/set";
11
+ *
12
+ * Set.create([1, 2, 3]); // Set([1, 2, 3])
13
+ * ```
14
+ */
15
+ function create(iterable) {
16
+ return new globalThis.Set(iterable);
17
+ }
18
+
19
+ //#endregion
20
+ export { create };
@@ -4,6 +4,8 @@
4
4
  * function Set.difference(target, source)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.difference(target, source)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.forEach(target, fn)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.forEach(target, fn)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.has(target, value)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.has(target, value)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.hasAll(target, values)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.hasAll(target, values)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.hasAny(target, values)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.hasAny(target, values)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.hasNone(target, values)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.hasNone(target, values)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -0,0 +1,39 @@
1
+ import { add } from "./add.mjs";
2
+ import { addAll } from "./addAll.mjs";
3
+ import { addOr } from "./addOr.mjs";
4
+ import { addOrElse } from "./addOrElse.mjs";
5
+ import { addOrThrow } from "./addOrThrow.mjs";
6
+ import { clone } from "./clone.mjs";
7
+ import { compact } from "./compact.mjs";
8
+ import { create } from "./create.mjs";
9
+ import { difference } from "./difference.mjs";
10
+ import { forEach } from "./forEach.mjs";
11
+ import { has } from "./has.mjs";
12
+ import { hasAll } from "./hasAll.mjs";
13
+ import { hasAny } from "./hasAny.mjs";
14
+ import { hasNone } from "./hasNone.mjs";
15
+ import { intersection } from "./intersection.mjs";
16
+ import { is } from "./is.mjs";
17
+ import { isDisjointFrom } from "./isDisjointFrom.mjs";
18
+ import { isEmpty } from "./isEmpty.mjs";
19
+ import { isShallowEqual } from "./isShallowEqual.mjs";
20
+ import { isSubsetOf } from "./isSubsetOf.mjs";
21
+ import { isSupersetOf } from "./isSupersetOf.mjs";
22
+ import { mapEach } from "./mapEach.mjs";
23
+ import { remove } from "./remove.mjs";
24
+ import { removeAll } from "./removeAll.mjs";
25
+ import { removeOr } from "./removeOr.mjs";
26
+ import { removeOrElse } from "./removeOrElse.mjs";
27
+ import { removeOrThrow } from "./removeOrThrow.mjs";
28
+ import { size } from "./size.mjs";
29
+ import { symmetricDifference } from "./symmetricDifference.mjs";
30
+ import { toArray } from "./toArray.mjs";
31
+ import { union } from "./union.mjs";
32
+
33
+ //#region src/Set/index.d.ts
34
+
35
+ declare namespace Set {
36
+ export { add, addAll, addOr, addOrElse, addOrThrow, clone, compact, create, difference, forEach, has, hasAll, hasAny, hasNone, intersection, is, isDisjointFrom, isEmpty, isShallowEqual, isSubsetOf, isSupersetOf, mapEach, remove, removeAll, removeOr, removeOrElse, removeOrThrow, size, symmetricDifference, toArray, union };
37
+ }
38
+ //#endregion
39
+ export { Set };
@@ -0,0 +1,69 @@
1
+ import { add } from "./add.mjs";
2
+ import { addAll } from "./addAll.mjs";
3
+ import { addOr } from "./addOr.mjs";
4
+ import { addOrElse } from "./addOrElse.mjs";
5
+ import { addOrThrow } from "./addOrThrow.mjs";
6
+ import { clone } from "./clone.mjs";
7
+ import { compact } from "./compact.mjs";
8
+ import { create } from "./create.mjs";
9
+ import { difference } from "./difference.mjs";
10
+ import { forEach } from "./forEach.mjs";
11
+ import { has } from "./has.mjs";
12
+ import { hasAll } from "./hasAll.mjs";
13
+ import { hasAny } from "./hasAny.mjs";
14
+ import { hasNone } from "./hasNone.mjs";
15
+ import { intersection } from "./intersection.mjs";
16
+ import { is } from "./is.mjs";
17
+ import { isDisjointFrom } from "./isDisjointFrom.mjs";
18
+ import { isEmpty } from "./isEmpty.mjs";
19
+ import { isShallowEqual } from "./isShallowEqual.mjs";
20
+ import { isSubsetOf } from "./isSubsetOf.mjs";
21
+ import { isSupersetOf } from "./isSupersetOf.mjs";
22
+ import { mapEach } from "./mapEach.mjs";
23
+ import { remove } from "./remove.mjs";
24
+ import { removeAll } from "./removeAll.mjs";
25
+ import { removeOr } from "./removeOr.mjs";
26
+ import { removeOrElse } from "./removeOrElse.mjs";
27
+ import { removeOrThrow } from "./removeOrThrow.mjs";
28
+ import { size } from "./size.mjs";
29
+ import { symmetricDifference } from "./symmetricDifference.mjs";
30
+ import { toArray } from "./toArray.mjs";
31
+ import { union } from "./union.mjs";
32
+
33
+ //#region src/Set/index.js
34
+ const Set = {
35
+ add,
36
+ addAll,
37
+ addOr,
38
+ addOrElse,
39
+ addOrThrow,
40
+ clone,
41
+ compact,
42
+ create,
43
+ difference,
44
+ forEach,
45
+ has,
46
+ hasAll,
47
+ hasAny,
48
+ hasNone,
49
+ intersection,
50
+ is,
51
+ isDisjointFrom,
52
+ isEmpty,
53
+ isShallowEqual,
54
+ isSubsetOf,
55
+ isSupersetOf,
56
+ mapEach,
57
+ remove,
58
+ removeAll,
59
+ removeOr,
60
+ removeOrElse,
61
+ removeOrThrow,
62
+ size,
63
+ symmetricDifference,
64
+ toArray,
65
+ union
66
+ };
67
+
68
+ //#endregion
69
+ export { Set };
@@ -4,6 +4,8 @@
4
4
  * function Set.intersection(target, source)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.intersection(target, source)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -0,0 +1,30 @@
1
+ //#region src/Set/is.d.ts
2
+ /**
3
+ * ```ts
4
+ * function Set.is(target)
5
+ * ```
6
+ *
7
+ * Example
8
+ *
9
+ * ```ts
10
+ * import { Set } from "@monstermann/set";
11
+ *
12
+ * Set.is(Set.create([1, 2, 3])); // true
13
+ * Set.is([1, 2, 3]); // false
14
+ * Set.is({}); // false
15
+ * ```
16
+ *
17
+ * ```ts
18
+ * import { Set } from "@monstermann/set";
19
+ *
20
+ * pipe(Set.create([1, 2, 3]), Set.is()); // true
21
+ * pipe([1, 2, 3], Set.is()); // false
22
+ * pipe({}, Set.is()); // false
23
+ * ```
24
+ */
25
+ declare const is: {
26
+ (): (target: unknown) => target is Set<unknown>;
27
+ (target: unknown): target is Set<unknown>;
28
+ };
29
+ //#endregion
30
+ export { is };
@@ -0,0 +1,32 @@
1
+ import { dfdlT } from "@monstermann/dfdl";
2
+
3
+ //#region src/Set/is.ts
4
+ /**
5
+ * ```ts
6
+ * function Set.is(target)
7
+ * ```
8
+ *
9
+ * Example
10
+ *
11
+ * ```ts
12
+ * import { Set } from "@monstermann/set";
13
+ *
14
+ * Set.is(Set.create([1, 2, 3])); // true
15
+ * Set.is([1, 2, 3]); // false
16
+ * Set.is({}); // false
17
+ * ```
18
+ *
19
+ * ```ts
20
+ * import { Set } from "@monstermann/set";
21
+ *
22
+ * pipe(Set.create([1, 2, 3]), Set.is()); // true
23
+ * pipe([1, 2, 3], Set.is()); // false
24
+ * pipe({}, Set.is()); // false
25
+ * ```
26
+ */
27
+ const is = dfdlT((target) => {
28
+ return target instanceof Set;
29
+ }, 1);
30
+
31
+ //#endregion
32
+ export { is };
@@ -4,6 +4,8 @@
4
4
  * function Set.isDisjointFrom(target, source)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.isDisjointFrom(target, source)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.isEmpty(target)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.isEmpty(target)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.isShallowEqual(target, source)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.isShallowEqual(target, source)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.isSubsetOf(target, source)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.isSubsetOf(target, source)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.isSupersetOf(target, source)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.isSupersetOf(target, source)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.mapEach(target, fn)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.mapEach(target, fn)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.remove(target, value)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -7,6 +7,8 @@ import { cloneSet } from "@monstermann/remmi";
7
7
  * function Set.remove(target, value)
8
8
  * ```
9
9
  *
10
+ * Example
11
+ *
10
12
  * ```ts
11
13
  * import { Set } from "@monstermann/set";
12
14
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.removeAll(target, values)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -7,6 +7,8 @@ import { cloneSet } from "@monstermann/remmi";
7
7
  * function Set.removeAll(target, values)
8
8
  * ```
9
9
  *
10
+ * Example
11
+ *
10
12
  * ```ts
11
13
  * import { Set } from "@monstermann/set";
12
14
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.removeOr(target, value, or)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -7,6 +7,8 @@ import { cloneSet } from "@monstermann/remmi";
7
7
  * function Set.removeOr(target, value, or)
8
8
  * ```
9
9
  *
10
+ * Example
11
+ *
10
12
  * ```ts
11
13
  * import { Set } from "@monstermann/set";
12
14
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.removeOrElse(target, value, orElse)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -7,6 +7,8 @@ import { cloneSet } from "@monstermann/remmi";
7
7
  * function Set.removeOrElse(target, value, orElse)
8
8
  * ```
9
9
  *
10
+ * Example
11
+ *
10
12
  * ```ts
11
13
  * import { Set } from "@monstermann/set";
12
14
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.removeOrThrow(target, value)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -7,6 +7,8 @@ import { cloneSet } from "@monstermann/remmi";
7
7
  * function Set.removeOrThrow(target, value)
8
8
  * ```
9
9
  *
10
+ * Example
11
+ *
10
12
  * ```ts
11
13
  * import { Set } from "@monstermann/set";
12
14
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.size(target)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.size(target)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.symmetricDifference(target, source)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.symmetricDifference(target, source)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.toArray(target)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.toArray(target)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -4,6 +4,8 @@
4
4
  * function Set.union(target, source)
5
5
  * ```
6
6
  *
7
+ * Example
8
+ *
7
9
  * ```ts
8
10
  * import { Set } from "@monstermann/set";
9
11
  *
@@ -6,6 +6,8 @@ import { dfdlT } from "@monstermann/dfdl";
6
6
  * function Set.union(target, source)
7
7
  * ```
8
8
  *
9
+ * Example
10
+ *
9
11
  * ```ts
10
12
  * import { Set } from "@monstermann/set";
11
13
  *
@@ -0,0 +1,2 @@
1
+ import { Set } from "./Set/index.mjs";
2
+ export { Set };
package/dist/index.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { Set } from "./Set/index.mjs";
2
+
3
+ export { Set };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@monstermann/set",
3
3
  "type": "module",
4
- "version": "0.0.0",
4
+ "version": "0.1.1",
5
5
  "description": "Functional utilities for sets.",
6
6
  "author": "Michael Ostermann <michaelostermann@me.com>",
7
7
  "license": "MIT",
@@ -17,13 +17,14 @@
17
17
  "sideEffects": false,
18
18
  "exports": {
19
19
  ".": {
20
- "types": "./dist/index.d.ts",
21
- "import": "./dist/index.js"
22
- }
20
+ "types": "./dist/index.d.mts",
21
+ "import": "./dist/index.mjs"
22
+ },
23
+ "./*": "./dist/*"
23
24
  },
24
- "main": "./dist/index.js",
25
- "module": "./dist/index.js",
26
- "types": "./dist/index.d.ts",
25
+ "main": "./dist/index.mjs",
26
+ "module": "./dist/index.mjs",
27
+ "types": "./dist/index.d.mts",
27
28
  "files": [
28
29
  "dist"
29
30
  ],
@@ -1,38 +0,0 @@
1
- import { add } from "./add.js";
2
- import { addAll } from "./addAll.js";
3
- import { addOr } from "./addOr.js";
4
- import { addOrElse } from "./addOrElse.js";
5
- import { addOrThrow } from "./addOrThrow.js";
6
- import { clone } from "./clone.js";
7
- import { compact } from "./compact.js";
8
- import { difference } from "./difference.js";
9
- import { forEach } from "./forEach.js";
10
- import { has } from "./has.js";
11
- import { hasAll } from "./hasAll.js";
12
- import { hasAny } from "./hasAny.js";
13
- import { hasNone } from "./hasNone.js";
14
- import { intersection } from "./intersection.js";
15
- import { isDisjointFrom } from "./isDisjointFrom.js";
16
- import { isEmpty } from "./isEmpty.js";
17
- import { isSet } from "./isSet.js";
18
- import { isShallowEqual } from "./isShallowEqual.js";
19
- import { isSubsetOf } from "./isSubsetOf.js";
20
- import { isSupersetOf } from "./isSupersetOf.js";
21
- import { mapEach } from "./mapEach.js";
22
- import { remove } from "./remove.js";
23
- import { removeAll } from "./removeAll.js";
24
- import { removeOr } from "./removeOr.js";
25
- import { removeOrElse } from "./removeOrElse.js";
26
- import { removeOrThrow } from "./removeOrThrow.js";
27
- import { size } from "./size.js";
28
- import { symmetricDifference } from "./symmetricDifference.js";
29
- import { toArray } from "./toArray.js";
30
- import { union } from "./union.js";
31
-
32
- //#region src/Set/index.d.ts
33
-
34
- declare namespace Set {
35
- export { add, addAll, addOr, addOrElse, addOrThrow, clone, compact, difference, forEach, has, hasAll, hasAny, hasNone, intersection, isDisjointFrom, isEmpty, isSet, isShallowEqual, isSubsetOf, isSupersetOf, mapEach, remove, removeAll, removeOr, removeOrElse, removeOrThrow, size, symmetricDifference, toArray, union };
36
- }
37
- //#endregion
38
- export { Set };
package/dist/Set/index.js DELETED
@@ -1,67 +0,0 @@
1
- import { add } from "./add.js";
2
- import { addAll } from "./addAll.js";
3
- import { addOr } from "./addOr.js";
4
- import { addOrElse } from "./addOrElse.js";
5
- import { addOrThrow } from "./addOrThrow.js";
6
- import { clone } from "./clone.js";
7
- import { compact } from "./compact.js";
8
- import { difference } from "./difference.js";
9
- import { forEach } from "./forEach.js";
10
- import { has } from "./has.js";
11
- import { hasAll } from "./hasAll.js";
12
- import { hasAny } from "./hasAny.js";
13
- import { hasNone } from "./hasNone.js";
14
- import { intersection } from "./intersection.js";
15
- import { isDisjointFrom } from "./isDisjointFrom.js";
16
- import { isEmpty } from "./isEmpty.js";
17
- import { isSet } from "./isSet.js";
18
- import { isShallowEqual } from "./isShallowEqual.js";
19
- import { isSubsetOf } from "./isSubsetOf.js";
20
- import { isSupersetOf } from "./isSupersetOf.js";
21
- import { mapEach } from "./mapEach.js";
22
- import { remove } from "./remove.js";
23
- import { removeAll } from "./removeAll.js";
24
- import { removeOr } from "./removeOr.js";
25
- import { removeOrElse } from "./removeOrElse.js";
26
- import { removeOrThrow } from "./removeOrThrow.js";
27
- import { size } from "./size.js";
28
- import { symmetricDifference } from "./symmetricDifference.js";
29
- import { toArray } from "./toArray.js";
30
- import { union } from "./union.js";
31
-
32
- //#region src/Set/index.js
33
- const Set = {
34
- add,
35
- addAll,
36
- addOr,
37
- addOrElse,
38
- addOrThrow,
39
- clone,
40
- compact,
41
- difference,
42
- forEach,
43
- has,
44
- hasAll,
45
- hasAny,
46
- hasNone,
47
- intersection,
48
- isDisjointFrom,
49
- isEmpty,
50
- isSet,
51
- isShallowEqual,
52
- isSubsetOf,
53
- isSupersetOf,
54
- mapEach,
55
- remove,
56
- removeAll,
57
- removeOr,
58
- removeOrElse,
59
- removeOrThrow,
60
- size,
61
- symmetricDifference,
62
- toArray,
63
- union
64
- };
65
-
66
- //#endregion
67
- export { Set };
@@ -1,28 +0,0 @@
1
- //#region src/Set/isSet.d.ts
2
- /**
3
- * ```ts
4
- * function Set.isSet(target)
5
- * ```
6
- *
7
- * ```ts
8
- * import { Set } from "@monstermann/set";
9
- *
10
- * Set.isSet(Set.create([1, 2, 3])); // true
11
- * Set.isSet([1, 2, 3]); // false
12
- * Set.isSet({}); // false
13
- * ```
14
- *
15
- * ```ts
16
- * import { Set } from "@monstermann/set";
17
- *
18
- * pipe(Set.create([1, 2, 3]), Set.isSet()); // true
19
- * pipe([1, 2, 3], Set.isSet()); // false
20
- * pipe({}, Set.isSet()); // false
21
- * ```
22
- */
23
- declare const isSet: {
24
- (): (target: unknown) => target is Set<unknown>;
25
- (target: unknown): target is Set<unknown>;
26
- };
27
- //#endregion
28
- export { isSet };
package/dist/Set/isSet.js DELETED
@@ -1,30 +0,0 @@
1
- import { dfdlT } from "@monstermann/dfdl";
2
-
3
- //#region src/Set/isSet.ts
4
- /**
5
- * ```ts
6
- * function Set.isSet(target)
7
- * ```
8
- *
9
- * ```ts
10
- * import { Set } from "@monstermann/set";
11
- *
12
- * Set.isSet(Set.create([1, 2, 3])); // true
13
- * Set.isSet([1, 2, 3]); // false
14
- * Set.isSet({}); // false
15
- * ```
16
- *
17
- * ```ts
18
- * import { Set } from "@monstermann/set";
19
- *
20
- * pipe(Set.create([1, 2, 3]), Set.isSet()); // true
21
- * pipe([1, 2, 3], Set.isSet()); // false
22
- * pipe({}, Set.isSet()); // false
23
- * ```
24
- */
25
- const isSet = dfdlT((target) => {
26
- return target instanceof Set;
27
- }, 1);
28
-
29
- //#endregion
30
- export { isSet };
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { Set } from "./Set/index.js";
2
- export { Set };
package/dist/index.js DELETED
@@ -1,3 +0,0 @@
1
- import { Set } from "./Set/index.js";
2
-
3
- export { Set };
File without changes