@monstermann/set 0.0.0 → 0.1.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.
Files changed (67) hide show
  1. package/dist/Set/add.d.ts +2 -0
  2. package/dist/Set/add.js +2 -0
  3. package/dist/Set/addAll.d.ts +2 -0
  4. package/dist/Set/addAll.js +2 -0
  5. package/dist/Set/addOr.d.ts +2 -0
  6. package/dist/Set/addOr.js +2 -0
  7. package/dist/Set/addOrElse.d.ts +2 -0
  8. package/dist/Set/addOrElse.js +2 -0
  9. package/dist/Set/addOrThrow.d.ts +2 -0
  10. package/dist/Set/addOrThrow.js +2 -0
  11. package/dist/Set/clone.d.ts +2 -0
  12. package/dist/Set/clone.js +2 -0
  13. package/dist/Set/compact.d.ts +2 -0
  14. package/dist/Set/compact.js +2 -0
  15. package/dist/Set/create.d.ts +17 -0
  16. package/dist/Set/create.js +20 -0
  17. package/dist/Set/difference.d.ts +2 -0
  18. package/dist/Set/difference.js +2 -0
  19. package/dist/Set/forEach.d.ts +2 -0
  20. package/dist/Set/forEach.js +2 -0
  21. package/dist/Set/has.d.ts +2 -0
  22. package/dist/Set/has.js +2 -0
  23. package/dist/Set/hasAll.d.ts +2 -0
  24. package/dist/Set/hasAll.js +2 -0
  25. package/dist/Set/hasAny.d.ts +2 -0
  26. package/dist/Set/hasAny.js +2 -0
  27. package/dist/Set/hasNone.d.ts +2 -0
  28. package/dist/Set/hasNone.js +2 -0
  29. package/dist/Set/index.d.ts +3 -2
  30. package/dist/Set/index.js +4 -2
  31. package/dist/Set/intersection.d.ts +2 -0
  32. package/dist/Set/intersection.js +2 -0
  33. package/dist/Set/is.d.ts +30 -0
  34. package/dist/Set/is.js +32 -0
  35. package/dist/Set/isDisjointFrom.d.ts +2 -0
  36. package/dist/Set/isDisjointFrom.js +2 -0
  37. package/dist/Set/isEmpty.d.ts +2 -0
  38. package/dist/Set/isEmpty.js +2 -0
  39. package/dist/Set/isShallowEqual.d.ts +2 -0
  40. package/dist/Set/isShallowEqual.js +2 -0
  41. package/dist/Set/isSubsetOf.d.ts +2 -0
  42. package/dist/Set/isSubsetOf.js +2 -0
  43. package/dist/Set/isSupersetOf.d.ts +2 -0
  44. package/dist/Set/isSupersetOf.js +2 -0
  45. package/dist/Set/mapEach.d.ts +2 -0
  46. package/dist/Set/mapEach.js +2 -0
  47. package/dist/Set/remove.d.ts +2 -0
  48. package/dist/Set/remove.js +2 -0
  49. package/dist/Set/removeAll.d.ts +2 -0
  50. package/dist/Set/removeAll.js +2 -0
  51. package/dist/Set/removeOr.d.ts +2 -0
  52. package/dist/Set/removeOr.js +2 -0
  53. package/dist/Set/removeOrElse.d.ts +2 -0
  54. package/dist/Set/removeOrElse.js +2 -0
  55. package/dist/Set/removeOrThrow.d.ts +2 -0
  56. package/dist/Set/removeOrThrow.js +2 -0
  57. package/dist/Set/size.d.ts +2 -0
  58. package/dist/Set/size.js +2 -0
  59. package/dist/Set/symmetricDifference.d.ts +2 -0
  60. package/dist/Set/symmetricDifference.js +2 -0
  61. package/dist/Set/toArray.d.ts +2 -0
  62. package/dist/Set/toArray.js +2 -0
  63. package/dist/Set/union.d.ts +2 -0
  64. package/dist/Set/union.js +2 -0
  65. package/package.json +3 -2
  66. package/dist/Set/isSet.d.ts +0 -28
  67. package/dist/Set/isSet.js +0 -30
package/dist/Set/add.d.ts CHANGED
@@ -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
  *
package/dist/Set/add.js CHANGED
@@ -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
  *
package/dist/Set/addOr.js CHANGED
@@ -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
  *
package/dist/Set/clone.js CHANGED
@@ -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
  *
@@ -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
  *
package/dist/Set/has.d.ts CHANGED
@@ -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
  *
package/dist/Set/has.js CHANGED
@@ -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
  *
@@ -5,6 +5,7 @@ import { addOrElse } from "./addOrElse.js";
5
5
  import { addOrThrow } from "./addOrThrow.js";
6
6
  import { clone } from "./clone.js";
7
7
  import { compact } from "./compact.js";
8
+ import { create } from "./create.js";
8
9
  import { difference } from "./difference.js";
9
10
  import { forEach } from "./forEach.js";
10
11
  import { has } from "./has.js";
@@ -12,9 +13,9 @@ import { hasAll } from "./hasAll.js";
12
13
  import { hasAny } from "./hasAny.js";
13
14
  import { hasNone } from "./hasNone.js";
14
15
  import { intersection } from "./intersection.js";
16
+ import { is } from "./is.js";
15
17
  import { isDisjointFrom } from "./isDisjointFrom.js";
16
18
  import { isEmpty } from "./isEmpty.js";
17
- import { isSet } from "./isSet.js";
18
19
  import { isShallowEqual } from "./isShallowEqual.js";
19
20
  import { isSubsetOf } from "./isSubsetOf.js";
20
21
  import { isSupersetOf } from "./isSupersetOf.js";
@@ -32,7 +33,7 @@ import { union } from "./union.js";
32
33
  //#region src/Set/index.d.ts
33
34
 
34
35
  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
+ 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 };
36
37
  }
37
38
  //#endregion
38
39
  export { Set };
package/dist/Set/index.js CHANGED
@@ -5,6 +5,7 @@ import { addOrElse } from "./addOrElse.js";
5
5
  import { addOrThrow } from "./addOrThrow.js";
6
6
  import { clone } from "./clone.js";
7
7
  import { compact } from "./compact.js";
8
+ import { create } from "./create.js";
8
9
  import { difference } from "./difference.js";
9
10
  import { forEach } from "./forEach.js";
10
11
  import { has } from "./has.js";
@@ -12,9 +13,9 @@ import { hasAll } from "./hasAll.js";
12
13
  import { hasAny } from "./hasAny.js";
13
14
  import { hasNone } from "./hasNone.js";
14
15
  import { intersection } from "./intersection.js";
16
+ import { is } from "./is.js";
15
17
  import { isDisjointFrom } from "./isDisjointFrom.js";
16
18
  import { isEmpty } from "./isEmpty.js";
17
- import { isSet } from "./isSet.js";
18
19
  import { isShallowEqual } from "./isShallowEqual.js";
19
20
  import { isSubsetOf } from "./isSubsetOf.js";
20
21
  import { isSupersetOf } from "./isSupersetOf.js";
@@ -38,6 +39,7 @@ const Set = {
38
39
  addOrThrow,
39
40
  clone,
40
41
  compact,
42
+ create,
41
43
  difference,
42
44
  forEach,
43
45
  has,
@@ -45,9 +47,9 @@ const Set = {
45
47
  hasAny,
46
48
  hasNone,
47
49
  intersection,
50
+ is,
48
51
  isDisjointFrom,
49
52
  isEmpty,
50
- isSet,
51
53
  isShallowEqual,
52
54
  isSubsetOf,
53
55
  isSupersetOf,
@@ -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 };
package/dist/Set/is.js ADDED
@@ -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
  *
package/dist/Set/size.js CHANGED
@@ -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
  *
package/dist/Set/union.js CHANGED
@@ -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
  *
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.0",
5
5
  "description": "Functional utilities for sets.",
6
6
  "author": "Michael Ostermann <michaelostermann@me.com>",
7
7
  "license": "MIT",
@@ -19,7 +19,8 @@
19
19
  ".": {
20
20
  "types": "./dist/index.d.ts",
21
21
  "import": "./dist/index.js"
22
- }
22
+ },
23
+ "./*": "./dist/*"
23
24
  },
24
25
  "main": "./dist/index.js",
25
26
  "module": "./dist/index.js",
@@ -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 };