@ts-fns/stdlib 0.1.0 → 0.2.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 (135) hide show
  1. package/dist/array/index.cjs +239 -37
  2. package/dist/array/index.cjs.map +1 -1
  3. package/dist/array/index.d.cts +437 -36
  4. package/dist/array/index.d.cts.map +1 -1
  5. package/dist/array/index.d.mts +437 -36
  6. package/dist/array/index.d.mts.map +1 -1
  7. package/dist/array/index.mjs +225 -22
  8. package/dist/array/index.mjs.map +1 -1
  9. package/dist/function/index.cjs +4 -2
  10. package/dist/function/index.d.cts +128 -13
  11. package/dist/function/index.d.cts.map +1 -1
  12. package/dist/function/index.d.mts +128 -13
  13. package/dist/function/index.d.mts.map +1 -1
  14. package/dist/function/index.mjs +3 -3
  15. package/dist/{function-DnI2v0p3.mjs → function-CYHPhQCQ.mjs} +84 -6
  16. package/dist/function-CYHPhQCQ.mjs.map +1 -0
  17. package/dist/{function-CB82a2GS.cjs → function-DYPifnmg.cjs} +95 -5
  18. package/dist/function-DYPifnmg.cjs.map +1 -0
  19. package/dist/{get-yrs1Kqho.cjs → get-1kqkxPFX.cjs} +20 -8
  20. package/dist/get-1kqkxPFX.cjs.map +1 -0
  21. package/dist/{get-CWL_cu6G.mjs → get-Dv6ejLZg.mjs} +21 -3
  22. package/dist/get-Dv6ejLZg.mjs.map +1 -0
  23. package/dist/guard/index.cjs +5 -12
  24. package/dist/guard/index.cjs.map +1 -1
  25. package/dist/guard/index.d.cts +18 -17
  26. package/dist/guard/index.d.cts.map +1 -1
  27. package/dist/guard/index.d.mts +18 -17
  28. package/dist/guard/index.d.mts.map +1 -1
  29. package/dist/guard/index.mjs +4 -12
  30. package/dist/guard/index.mjs.map +1 -1
  31. package/dist/index-MbdqaUt1.d.cts +54 -0
  32. package/dist/index-MbdqaUt1.d.cts.map +1 -0
  33. package/dist/index-k-paNOu4.d.mts +54 -0
  34. package/dist/index-k-paNOu4.d.mts.map +1 -0
  35. package/dist/iterator/index.cjs +72 -26
  36. package/dist/iterator/index.cjs.map +1 -1
  37. package/dist/iterator/index.d.cts +157 -5
  38. package/dist/iterator/index.d.cts.map +1 -1
  39. package/dist/iterator/index.d.mts +157 -5
  40. package/dist/iterator/index.d.mts.map +1 -1
  41. package/dist/iterator/index.mjs +66 -24
  42. package/dist/iterator/index.mjs.map +1 -1
  43. package/dist/lens/index.cjs +3 -3
  44. package/dist/lens/index.cjs.map +1 -1
  45. package/dist/lens/index.mjs +3 -3
  46. package/dist/lens/index.mjs.map +1 -1
  47. package/dist/map/index.cjs +88 -1
  48. package/dist/map/index.cjs.map +1 -1
  49. package/dist/map/index.d.cts +130 -2
  50. package/dist/map/index.d.cts.map +1 -1
  51. package/dist/map/index.d.mts +130 -2
  52. package/dist/map/index.d.mts.map +1 -1
  53. package/dist/map/index.mjs +86 -2
  54. package/dist/map/index.mjs.map +1 -1
  55. package/dist/number/index.cjs +91 -18
  56. package/dist/number/index.cjs.map +1 -1
  57. package/dist/number/index.d.cts +134 -19
  58. package/dist/number/index.d.cts.map +1 -1
  59. package/dist/number/index.d.mts +134 -19
  60. package/dist/number/index.d.mts.map +1 -1
  61. package/dist/number/index.mjs +91 -18
  62. package/dist/number/index.mjs.map +1 -1
  63. package/dist/object/index.cjs +111 -7
  64. package/dist/object/index.cjs.map +1 -1
  65. package/dist/object/index.d.cts +186 -26
  66. package/dist/object/index.d.cts.map +1 -1
  67. package/dist/object/index.d.mts +186 -26
  68. package/dist/object/index.d.mts.map +1 -1
  69. package/dist/object/index.mjs +111 -7
  70. package/dist/object/index.mjs.map +1 -1
  71. package/dist/orNull-CJNrTjhQ.cjs +45 -0
  72. package/dist/orNull-CJNrTjhQ.cjs.map +1 -0
  73. package/dist/orNull-EeXiCxD4.mjs +34 -0
  74. package/dist/orNull-EeXiCxD4.mjs.map +1 -0
  75. package/dist/order/index.cjs +22 -1
  76. package/dist/order/index.cjs.map +1 -1
  77. package/dist/order/index.d.cts +2 -2
  78. package/dist/order/index.d.mts +2 -2
  79. package/dist/order/index.mjs +22 -1
  80. package/dist/order/index.mjs.map +1 -1
  81. package/dist/{order.constants-BWSCg3C7.d.cts → order.constants-DpGY-EDp.d.cts} +4 -1
  82. package/dist/order.constants-DpGY-EDp.d.cts.map +1 -0
  83. package/dist/{order.constants-BWSCg3C7.d.mts → order.constants-DpGY-EDp.d.mts} +4 -1
  84. package/dist/order.constants-DpGY-EDp.d.mts.map +1 -0
  85. package/dist/purry-DXnhXie9.mjs +22 -0
  86. package/dist/purry-DXnhXie9.mjs.map +1 -0
  87. package/dist/purry-Dqp_F64t.cjs +27 -0
  88. package/dist/purry-Dqp_F64t.cjs.map +1 -0
  89. package/dist/set/index.cjs +59 -1
  90. package/dist/set/index.cjs.map +1 -1
  91. package/dist/set/index.d.cts +151 -2
  92. package/dist/set/index.d.cts.map +1 -1
  93. package/dist/set/index.d.mts +151 -2
  94. package/dist/set/index.d.mts.map +1 -1
  95. package/dist/set/index.mjs +59 -2
  96. package/dist/set/index.mjs.map +1 -1
  97. package/dist/string/index.cjs +289 -15
  98. package/dist/string/index.cjs.map +1 -1
  99. package/dist/string/index.d.cts +406 -1
  100. package/dist/string/index.d.cts.map +1 -1
  101. package/dist/string/index.d.mts +406 -1
  102. package/dist/string/index.d.mts.map +1 -1
  103. package/dist/string/index.mjs +271 -4
  104. package/dist/string/index.mjs.map +1 -1
  105. package/dist/tuple/index.cjs +20 -21
  106. package/dist/tuple/index.cjs.map +1 -1
  107. package/dist/tuple/index.d.cts +27 -58
  108. package/dist/tuple/index.d.cts.map +1 -1
  109. package/dist/tuple/index.d.mts +27 -58
  110. package/dist/tuple/index.d.mts.map +1 -1
  111. package/dist/tuple/index.mjs +20 -22
  112. package/dist/tuple/index.mjs.map +1 -1
  113. package/package.json +55 -127
  114. package/dist/function-CB82a2GS.cjs.map +0 -1
  115. package/dist/function-DnI2v0p3.mjs.map +0 -1
  116. package/dist/get-CWL_cu6G.mjs.map +0 -1
  117. package/dist/get-yrs1Kqho.cjs.map +0 -1
  118. package/dist/index-BJlKyBJH.d.cts +0 -18
  119. package/dist/index-BJlKyBJH.d.cts.map +0 -1
  120. package/dist/index-DGrnGMDt.d.mts +0 -18
  121. package/dist/index-DGrnGMDt.d.mts.map +0 -1
  122. package/dist/isNotNil-DrF-ohem.cjs +0 -28
  123. package/dist/isNotNil-DrF-ohem.cjs.map +0 -1
  124. package/dist/isNotNil-R5f1hC53.mjs +0 -23
  125. package/dist/isNotNil-R5f1hC53.mjs.map +0 -1
  126. package/dist/orThrow-V91Jw2lF.mjs +0 -15
  127. package/dist/orThrow-V91Jw2lF.mjs.map +0 -1
  128. package/dist/orThrow-ejzcQYAI.cjs +0 -20
  129. package/dist/orThrow-ejzcQYAI.cjs.map +0 -1
  130. package/dist/order.constants-BWSCg3C7.d.cts.map +0 -1
  131. package/dist/order.constants-BWSCg3C7.d.mts.map +0 -1
  132. package/dist/purry-B2_0DGLV.cjs +0 -28
  133. package/dist/purry-B2_0DGLV.cjs.map +0 -1
  134. package/dist/purry-BOWmqwDB.mjs +0 -23
  135. package/dist/purry-BOWmqwDB.mjs.map +0 -1
@@ -1,61 +1,210 @@
1
+ //#region src/set/_globalAliases.d.ts
2
+ /**
3
+ * Alias of the built-in set constructor. `new Set() === new Set.Ctor()`
4
+ * @function
5
+ */
6
+ declare const Ctor: SetConstructor;
7
+ //#endregion
1
8
  //#region src/set/add.d.ts
9
+ /**
10
+ * Adds a value to a set and returns the same set.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * add(new Set([1]), 2); // Set(2) { 1, 2 }
15
+ * add(3)(new Set([1, 2])); // Set(3) { 1, 2, 3 }
16
+ * ```
17
+ */
2
18
  declare function add<T>(value: T): (data: Set<T>) => Set<T>;
3
19
  declare function add<T>(data: Set<T>, value: T): Set<T>;
4
20
  //#endregion
5
21
  //#region src/set/clear.d.ts
22
+ /**
23
+ * Removes all values from a set and returns the same set.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * clear(new Set([1, 2, 3])); // Set(0) {}
28
+ * ```
29
+ */
6
30
  declare function clear<T>(data: Set<T>): Set<T>;
7
31
  //#endregion
8
32
  //#region src/set/difference.d.ts
33
+ /**
34
+ * Returns a new set containing values in the first set but not the second.
35
+ *
36
+ * @example
37
+ * ```ts
38
+ * difference(new Set([1, 2, 3]), new Set([2, 3, 4])); // Set(1) { 1 }
39
+ * difference(new Set([2, 3, 4]))(new Set([1, 2, 3])); // Set(1) { 1 }
40
+ * ```
41
+ */
9
42
  declare function difference<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => Set<T>;
10
43
  declare function difference<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T>;
11
44
  //#endregion
12
45
  //#region src/set/entries.d.ts
46
+ /**
47
+ * Returns an iterator of a set's value-key pairs.
48
+ * For sets, each entry repeats the same value as both key and value.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * [...entries(new Set([1, 2]))]; // [[1, 1], [2, 2]]
53
+ * ```
54
+ */
13
55
  declare function entries<T>(data: Set<T>): SetIterator<[T, T]>;
14
56
  //#endregion
15
57
  //#region src/set/forEach.d.ts
58
+ /**
59
+ * Runs a callback for each set value and returns the same set.
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const set = new Set([1, 2, 3]);
64
+ * forEach(set, value => console.log(value)); // set
65
+ * forEach(value => console.log(value))(set); // set
66
+ * ```
67
+ */
16
68
  declare function forEach<T>(callbackfn: (value: T, key: T, set: Set<T>) => void): (data: Set<T>) => Set<T>;
17
69
  declare function forEach<T>(data: Set<T>, callbackfn: (value: T, key: T, set: Set<T>) => void): Set<T>;
18
70
  //#endregion
19
71
  //#region src/set/from.d.ts
72
+ /**
73
+ * Creates a set from an iterable of values.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * from([1, 2, 2, 3]); // Set(3) { 1, 2, 3 }
78
+ * ```
79
+ */
20
80
  declare function from<T>(iterable: Iterable<T> | readonly T[]): Set<T>;
81
+ /**
82
+ * Creates an empty set.
83
+ *
84
+ * @example
85
+ * ```ts
86
+ * empty(); // Set(0) {}
87
+ * ```
88
+ */
21
89
  declare function empty<T>(): Set<T>;
22
90
  //#endregion
23
91
  //#region src/set/has.d.ts
92
+ /**
93
+ * Returns whether a set contains a value.
94
+ *
95
+ * @example
96
+ * ```ts
97
+ * has(new Set([1, 2]), 1); // true
98
+ * has(new Set([1, 2]), 3); // false
99
+ * has(2)(new Set([1, 2])); // true
100
+ * ```
101
+ */
24
102
  declare function has<T>(value: T): (data: Set<T>) => Set<T>;
25
103
  declare function has<T>(data: Set<T>, value: T): Set<T>;
26
104
  //#endregion
27
105
  //#region src/set/intersection.d.ts
106
+ /**
107
+ * Returns a new set containing values present in both sets.
108
+ *
109
+ * @example
110
+ * ```ts
111
+ * intersection(new Set([1, 2, 3]), new Set([2, 3, 4])); // Set(2) { 2, 3 }
112
+ * intersection(new Set([2, 3, 4]))(new Set([1, 2, 3])); // Set(2) { 2, 3 }
113
+ * ```
114
+ */
28
115
  declare function intersection<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => Set<T & U>;
29
116
  declare function intersection<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T & U>;
30
117
  //#endregion
31
118
  //#region src/set/isDisjointFrom.d.ts
119
+ /**
120
+ * Returns whether two sets share no values.
121
+ *
122
+ * @example
123
+ * ```ts
124
+ * isDisjointFrom(new Set([1, 2]), new Set([3, 4])); // true
125
+ * isDisjointFrom(new Set([1, 2]), new Set([2, 3])); // false
126
+ * isDisjointFrom(new Set([2, 3]))(new Set([1, 2])); // false
127
+ * ```
128
+ */
32
129
  declare function isDisjointFrom<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => boolean;
33
130
  declare function isDisjointFrom<T, U>(data: Set<T>, other: ReadonlySetLike<U>): boolean;
34
131
  //#endregion
35
132
  //#region src/set/isSubsetOf.d.ts
133
+ /**
134
+ * Returns whether every value in the first set is contained in the second.
135
+ *
136
+ * @example
137
+ * ```ts
138
+ * isSubsetOf(new Set([1, 2]), new Set([1, 2, 3])); // true
139
+ * isSubsetOf(new Set([1, 4]), new Set([1, 2, 3])); // false
140
+ * isSubsetOf(new Set([1, 2, 3]))(new Set([1, 2])); // true
141
+ * ```
142
+ */
36
143
  declare function isSubsetOf<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => boolean;
37
144
  declare function isSubsetOf<T, U>(data: Set<T>, other: ReadonlySetLike<U>): boolean;
38
145
  //#endregion
39
146
  //#region src/set/keys.d.ts
147
+ /**
148
+ * Returns an iterator of a set's values.
149
+ * For sets, keys and values are the same.
150
+ *
151
+ * @example
152
+ * ```ts
153
+ * [...keys(new Set([1, 2, 3]))]; // [1, 2, 3]
154
+ * ```
155
+ */
40
156
  declare function keys<T>(data: Set<T>): SetIterator<T>;
41
157
  //#endregion
42
158
  //#region src/set/remove.d.ts
43
159
  /**
44
- * TODO: should this return a tuple?
160
+ * Removes a value from a set and returns the same set.
161
+ *
162
+ * @example
163
+ * ```ts
164
+ * const set = new Set([1, 2, 3]);
165
+ * remove(set, 2); // Set(2) { 1, 3 }
166
+ * remove(3)(set); // Set(1) { 1 }
167
+ * ```
45
168
  */
46
169
  declare function remove<T>(value: T): (data: Set<T>) => Set<T>;
47
170
  declare function remove<T>(data: Set<T>, value: T): Set<T>;
48
171
  //#endregion
49
172
  //#region src/set/symmetricDifference.d.ts
173
+ /**
174
+ * Returns a new set containing values in either set but not both.
175
+ *
176
+ * @example
177
+ * ```ts
178
+ * symmetricDifference(new Set([1, 2, 3]), new Set([2, 3, 4])); // Set(2) { 1, 4 }
179
+ * symmetricDifference(new Set([2, 3, 4]))(new Set([1, 2, 3])); // Set(2) { 1, 4 }
180
+ * ```
181
+ */
50
182
  declare function symmetricDifference<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => Set<T | U>;
51
183
  declare function symmetricDifference<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T | U>;
52
184
  //#endregion
53
185
  //#region src/set/union.d.ts
186
+ /**
187
+ * Returns a new set containing all values from both sets.
188
+ *
189
+ * @example
190
+ * ```ts
191
+ * union(new Set([1, 2]), new Set([2, 3])); // Set(3) { 1, 2, 3 }
192
+ * union(new Set([2, 3]))(new Set([1, 2])); // Set(3) { 1, 2, 3 }
193
+ * ```
194
+ */
54
195
  declare function union<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => Set<T | U>;
55
196
  declare function union<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T | U>;
56
197
  //#endregion
57
198
  //#region src/set/values.d.ts
199
+ /**
200
+ * Returns an iterator of a set's values.
201
+ *
202
+ * @example
203
+ * ```ts
204
+ * [...values(new Set([1, 2, 3]))]; // [1, 2, 3]
205
+ * ```
206
+ */
58
207
  declare function values<T>(data: Set<T>): SetIterator<T>;
59
208
  //#endregion
60
- export { add, clear, difference, empty, entries, forEach, from, has, intersection, isDisjointFrom, isSubsetOf, keys, remove, symmetricDifference, union, values };
209
+ export { Ctor, add, clear, difference, empty, entries, forEach, from, has, intersection, isDisjointFrom, isSubsetOf, keys, remove, symmetricDifference, union, values };
61
210
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/set/add.ts","../../src/set/clear.ts","../../src/set/difference.ts","../../src/set/entries.ts","../../src/set/forEach.ts","../../src/set/from.ts","../../src/set/has.ts","../../src/set/intersection.ts","../../src/set/isDisjointFrom.ts","../../src/set/isSubsetOf.ts","../../src/set/keys.ts","../../src/set/remove.ts","../../src/set/symmetricDifference.ts","../../src/set/union.ts","../../src/set/values.ts"],"mappings":";iBAMgB,GAAA,IAAO,KAAA,EAAO,CAAA,IAAK,IAAA,EAAM,GAAA,CAAI,CAAA,MAAO,GAAA,CAAI,CAAA;AAAA,iBACxC,GAAA,IAAO,IAAA,EAAM,GAAA,CAAI,CAAA,GAAI,KAAA,EAAO,CAAA,GAAI,GAAA,CAAI,CAAA;;;iBCPpC,KAAA,IAAS,IAAA,EAAM,GAAA,CAA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,GAAI,CAAA;;;iBCP9D,MAAA,IAAU,IAAA,EAAM,GAAA,CAAI,CAAA,IAAK,WAAA,CAAY,CAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/set/_globalAliases.ts","../../src/set/add.ts","../../src/set/clear.ts","../../src/set/difference.ts","../../src/set/entries.ts","../../src/set/forEach.ts","../../src/set/from.ts","../../src/set/has.ts","../../src/set/intersection.ts","../../src/set/isDisjointFrom.ts","../../src/set/isSubsetOf.ts","../../src/set/keys.ts","../../src/set/remove.ts","../../src/set/symmetricDifference.ts","../../src/set/union.ts","../../src/set/values.ts"],"mappings":";;AAIA;;;cAAa,IAAA,EAAI,cAAM;;;;AAAvB;;;;AAAuB;;;;iBCWP,GAAA,IAAO,KAAA,EAAO,CAAA,IAAK,IAAA,EAAM,GAAA,CAAI,CAAA,MAAO,GAAA,CAAI,CAAA;AAAA,iBACxC,GAAA,IAAO,IAAA,EAAM,GAAA,CAAI,CAAA,GAAI,KAAA,EAAO,CAAA,GAAI,GAAA,CAAI,CAAA;;;;ADZpD;;;;AAAuB;;;iBEIP,KAAA,IAAS,IAAA,EAAM,GAAA,CAAI,CAAA,IAAK,GAAA,CAAI,CAAA;;;;AFJ5C;;;;AAAuB;;;;iBGWP,UAAA,IAAc,KAAA,EAAO,eAAA,CAAgB,CAAA,QAAS,IAAA,EAAM,GAAA,CAAI,CAAA,MAAO,GAAA,CAAI,CAAA;AAAA,iBACnE,UAAA,OAAiB,IAAA,EAAM,GAAA,CAAI,CAAA,GAAI,KAAA,EAAO,eAAA,CAAgB,CAAA,IAAK,GAAA,CAAI,CAAA;;;;AHZ/E;;;;AAAuB;;;;iBIKP,OAAA,IAAW,IAAA,EAAM,GAAA,CAAI,CAAA,IAAK,WAAA,EAAa,CAAA,EAAG,CAAA;;;;AJL1D;;;;AAAuB;;;;ACWvB;iBIEgB,OAAA,IAAW,UAAA,GAAa,KAAA,EAAO,CAAA,EAAG,GAAA,EAAK,CAAA,EAAG,GAAA,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
+ //#region src/set/_globalAliases.ts
3
+ /**
4
+ * Alias of the built-in set constructor. `new Set() === new Set.Ctor()`
5
+ * @function
6
+ */
7
+ const Ctor = Set;
8
+ //#endregion
2
9
  //#region src/set/add.ts
3
10
  function addImplementation(data, value) {
4
11
  return data.add(value);
@@ -8,6 +15,14 @@ function add(...args) {
8
15
  }
9
16
  //#endregion
10
17
  //#region src/set/clear.ts
18
+ /**
19
+ * Removes all values from a set and returns the same set.
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * clear(new Set([1, 2, 3])); // Set(0) {}
24
+ * ```
25
+ */
11
26
  function clear(data) {
12
27
  data.clear();
13
28
  return data;
@@ -22,6 +37,15 @@ function difference(...args) {
22
37
  }
23
38
  //#endregion
24
39
  //#region src/set/entries.ts
40
+ /**
41
+ * Returns an iterator of a set's value-key pairs.
42
+ * For sets, each entry repeats the same value as both key and value.
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * [...entries(new Set([1, 2]))]; // [[1, 1], [2, 2]]
47
+ * ```
48
+ */
25
49
  function entries(data) {
26
50
  return data.entries();
27
51
  }
@@ -36,9 +60,25 @@ function forEach(...args) {
36
60
  }
37
61
  //#endregion
38
62
  //#region src/set/from.ts
63
+ /**
64
+ * Creates a set from an iterable of values.
65
+ *
66
+ * @example
67
+ * ```ts
68
+ * from([1, 2, 2, 3]); // Set(3) { 1, 2, 3 }
69
+ * ```
70
+ */
39
71
  function from(iterable) {
40
72
  return new Set(iterable);
41
73
  }
74
+ /**
75
+ * Creates an empty set.
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * empty(); // Set(0) {}
80
+ * ```
81
+ */
42
82
  function empty() {
43
83
  return /* @__PURE__ */ new Set();
44
84
  }
@@ -76,6 +116,15 @@ function isSubsetOf(...args) {
76
116
  }
77
117
  //#endregion
78
118
  //#region src/set/keys.ts
119
+ /**
120
+ * Returns an iterator of a set's values.
121
+ * For sets, keys and values are the same.
122
+ *
123
+ * @example
124
+ * ```ts
125
+ * [...keys(new Set([1, 2, 3]))]; // [1, 2, 3]
126
+ * ```
127
+ */
79
128
  function keys(data) {
80
129
  return data.keys();
81
130
  }
@@ -106,10 +155,18 @@ function union(...args) {
106
155
  }
107
156
  //#endregion
108
157
  //#region src/set/values.ts
158
+ /**
159
+ * Returns an iterator of a set's values.
160
+ *
161
+ * @example
162
+ * ```ts
163
+ * [...values(new Set([1, 2, 3]))]; // [1, 2, 3]
164
+ * ```
165
+ */
109
166
  function values(data) {
110
167
  return data.values();
111
168
  }
112
169
  //#endregion
113
- export { add, clear, difference, empty, entries, forEach, from, has, intersection, isDisjointFrom, isSubsetOf, keys, remove, symmetricDifference, union, values };
170
+ export { Ctor, add, clear, difference, empty, entries, forEach, from, has, intersection, isDisjointFrom, isSubsetOf, keys, remove, symmetricDifference, union, values };
114
171
 
115
172
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../src/set/add.ts","../../src/set/clear.ts","../../src/set/difference.ts","../../src/set/entries.ts","../../src/set/forEach.ts","../../src/set/from.ts","../../src/set/has.ts","../../src/set/intersection.ts","../../src/set/isDisjointFrom.ts","../../src/set/isSubsetOf.ts","../../src/set/keys.ts","../../src/set/remove.ts","../../src/set/symmetricDifference.ts","../../src/set/union.ts","../../src/set/values.ts"],"sourcesContent":["import { purry } from '../function/purry';\n\nfunction addImplementation<T>(data: Set<T>, value: T): Set<T> {\n return data.add(value);\n}\n\nexport function add<T>(value: T): (data: Set<T>) => Set<T>;\nexport function add<T>(data: Set<T>, value: T): Set<T>;\nexport function add(...args: readonly unknown[]): unknown {\n return purry(addImplementation, args);\n}\n","export function clear<T>(data: Set<T>): Set<T> {\n data.clear();\n return data;\n}\n","import { purry } from '../function/purry';\n\nfunction differenceImplementation<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T> {\n return data.difference(other);\n}\n\nexport function difference<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => Set<T>;\nexport function difference<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T>;\nexport function difference(...args: readonly unknown[]): unknown {\n return purry(differenceImplementation, args);\n}\n","export function entries<T>(data: Set<T>): SetIterator<[T, T]> {\n return data.entries();\n}\n","import { purry } from '../function/purry';\n\nfunction forEachImplementation<T>(data: Set<T>, callbackfn: (value: T, key: T, set: Set<T>) => void): Set<T> {\n data.forEach(callbackfn);\n return data;\n}\n\nexport function forEach<T>(callbackfn: (value: T, key: T, set: Set<T>) => void): (data: Set<T>) => Set<T>;\nexport function forEach<T>(data: Set<T>, callbackfn: (value: T, key: T, set: Set<T>) => void): Set<T>;\nexport function forEach(...args: readonly unknown[]): unknown {\n return purry(forEachImplementation, args);\n}\n","export function from<T>(iterable: Iterable<T> | readonly T[]): Set<T> {\n return new Set(iterable);\n}\n\nexport function empty<T>(): Set<T> {\n return new Set();\n}\n","import { purry } from '../function/purry';\n\nfunction hasImplementation<T>(data: Set<T>, value: T): boolean {\n return data.has(value);\n}\n\nexport function has<T>(value: T): (data: Set<T>) => Set<T>;\nexport function has<T>(data: Set<T>, value: T): Set<T>;\nexport function has(...args: readonly unknown[]): unknown {\n return purry(hasImplementation, args);\n}\n","import { purry } from '../function/purry';\n\nfunction intersectionImplementation<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T & U> {\n return data.intersection(other);\n}\n\nexport function intersection<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => Set<T & U>;\nexport function intersection<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T & U>;\nexport function intersection(...args: readonly unknown[]): unknown {\n return purry(intersectionImplementation, args);\n}\n","import { purry } from '../function/purry';\n\nfunction isDisjointFromImplementation<T, U>(data: Set<T>, other: ReadonlySetLike<U>): boolean {\n return data.isDisjointFrom(other);\n}\n\nexport function isDisjointFrom<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => boolean;\nexport function isDisjointFrom<T, U>(data: Set<T>, other: ReadonlySetLike<U>): boolean;\nexport function isDisjointFrom(...args: readonly unknown[]): unknown {\n return purry(isDisjointFromImplementation, args);\n}\n","import { purry } from '../function/purry';\n\nfunction isSubsetOfImplementation<T, U>(data: Set<T>, other: ReadonlySetLike<U>): boolean {\n return data.isSubsetOf(other);\n}\n\nexport function isSubsetOf<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => boolean;\nexport function isSubsetOf<T, U>(data: Set<T>, other: ReadonlySetLike<U>): boolean;\nexport function isSubsetOf(...args: readonly unknown[]): unknown {\n return purry(isSubsetOfImplementation, args);\n}\n","export function keys<T>(data: Set<T>): SetIterator<T> {\n return data.keys();\n}\n","import { purry } from '../function/purry';\n\nfunction removeImplementation<T>(data: Set<T>, value: T): Set<T> {\n data.delete(value);\n return data;\n}\n\n/**\n * TODO: should this return a tuple?\n */\nexport function remove<T>(value: T): (data: Set<T>) => Set<T>;\nexport function remove<T>(data: Set<T>, value: T): Set<T>;\nexport function remove(...args: readonly unknown[]): unknown {\n return purry(removeImplementation, args);\n}\n","import { purry } from '../function/purry';\n\nfunction symmetricDifferenceImplementation<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T | U> {\n return data.symmetricDifference(other);\n}\n\nexport function symmetricDifference<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => Set<T | U>;\nexport function symmetricDifference<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T | U>;\nexport function symmetricDifference(...args: readonly unknown[]): unknown {\n return purry(symmetricDifferenceImplementation, args);\n}\n","import { purry } from '../function/purry';\n\nfunction unionImplementation<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T | U> {\n return data.union(other);\n}\n\nexport function union<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => Set<T | U>;\nexport function union<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T | U>;\nexport function union(...args: readonly unknown[]): unknown {\n return purry(unionImplementation, args);\n}\n","export function values<T>(data: Set<T>): SetIterator<T> {\n return data.values();\n}\n"],"mappings":";;AAEA,SAAS,kBAAqB,MAAc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AI;AAC7C;;;ACVA,SAAgB,KAAQ,MAA8B;CACpD,OAAO,KAAK,KAAK;AACnB;;;ACAA,SAAS,qBAAwB,MAAc,OAAkB;CAC/D,KAAK,OAAO,KAAK;CACjB,OAAO;AACT;AAOA,SAAgB,OAAO,GAAG,MAAmC;CAC3D,OAAO,MAAM,sBAAsB,IAAI;AACzC;;;ACZA,SAAS,kCAAwC,MAAc,OAAuC;CACpG,OAAO,KAAK,oBAAoB,KAAK;AACvC;AAIA,SAAgB,oBAAoB,GAAG,MAAmC;CACxE,OAAO,MAAM,mCAAmC,IAAI;AACtD;;;ACRA,SAAS,oBAA0B,MAAc,OAAuC;CACtF,OAAO,KAAK,MAAM,KAAK;AACzB;AAIA,SAAgB,MAAM,GAAG,MAAmC;CAC1D,OAAO,MAAM,qBAAqB,IAAI;AACxC;;;ACVA,SAAgB,OAAU,MAA8B;CACtD,OAAO,KAAK,OAAO;AACrB"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../src/set/_globalAliases.ts","../../src/set/add.ts","../../src/set/clear.ts","../../src/set/difference.ts","../../src/set/entries.ts","../../src/set/forEach.ts","../../src/set/from.ts","../../src/set/has.ts","../../src/set/intersection.ts","../../src/set/isDisjointFrom.ts","../../src/set/isSubsetOf.ts","../../src/set/keys.ts","../../src/set/remove.ts","../../src/set/symmetricDifference.ts","../../src/set/union.ts","../../src/set/values.ts"],"sourcesContent":["/**\n * Alias of the built-in set constructor. `new Set() === new Set.Ctor()`\n * @function\n */\nexport const Ctor = Set;\n","import { purry } from '../function/purry';\n\nfunction addImplementation<T>(data: Set<T>, value: T): Set<T> {\n return data.add(value);\n}\n\n/**\n * Adds a value to a set and returns the same set.\n *\n * @example\n * ```ts\n * add(new Set([1]), 2); // Set(2) { 1, 2 }\n * add(3)(new Set([1, 2])); // Set(3) { 1, 2, 3 }\n * ```\n */\nexport function add<T>(value: T): (data: Set<T>) => Set<T>;\nexport function add<T>(data: Set<T>, value: T): Set<T>;\nexport function add(...args: readonly unknown[]): unknown {\n return purry(addImplementation, args);\n}\n","/**\n * Removes all values from a set and returns the same set.\n *\n * @example\n * ```ts\n * clear(new Set([1, 2, 3])); // Set(0) {}\n * ```\n */\nexport function clear<T>(data: Set<T>): Set<T> {\n data.clear();\n return data;\n}\n","import { purry } from '../function/purry';\n\nfunction differenceImplementation<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T> {\n return data.difference(other);\n}\n\n/**\n * Returns a new set containing values in the first set but not the second.\n *\n * @example\n * ```ts\n * difference(new Set([1, 2, 3]), new Set([2, 3, 4])); // Set(1) { 1 }\n * difference(new Set([2, 3, 4]))(new Set([1, 2, 3])); // Set(1) { 1 }\n * ```\n */\nexport function difference<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => Set<T>;\nexport function difference<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T>;\nexport function difference(...args: readonly unknown[]): unknown {\n return purry(differenceImplementation, args);\n}\n","/**\n * Returns an iterator of a set's value-key pairs.\n * For sets, each entry repeats the same value as both key and value.\n *\n * @example\n * ```ts\n * [...entries(new Set([1, 2]))]; // [[1, 1], [2, 2]]\n * ```\n */\nexport function entries<T>(data: Set<T>): SetIterator<[T, T]> {\n return data.entries();\n}\n","import { purry } from '../function/purry';\n\nfunction forEachImplementation<T>(data: Set<T>, callbackfn: (value: T, key: T, set: Set<T>) => void): Set<T> {\n data.forEach(callbackfn);\n return data;\n}\n\n/**\n * Runs a callback for each set value and returns the same set.\n *\n * @example\n * ```ts\n * const set = new Set([1, 2, 3]);\n * forEach(set, value => console.log(value)); // set\n * forEach(value => console.log(value))(set); // set\n * ```\n */\nexport function forEach<T>(callbackfn: (value: T, key: T, set: Set<T>) => void): (data: Set<T>) => Set<T>;\nexport function forEach<T>(data: Set<T>, callbackfn: (value: T, key: T, set: Set<T>) => void): Set<T>;\nexport function forEach(...args: readonly unknown[]): unknown {\n return purry(forEachImplementation, args);\n}\n","/**\n * Creates a set from an iterable of values.\n *\n * @example\n * ```ts\n * from([1, 2, 2, 3]); // Set(3) { 1, 2, 3 }\n * ```\n */\nexport function from<T>(iterable: Iterable<T> | readonly T[]): Set<T> {\n return new Set(iterable);\n}\n\n/**\n * Creates an empty set.\n *\n * @example\n * ```ts\n * empty(); // Set(0) {}\n * ```\n */\nexport function empty<T>(): Set<T> {\n return new Set();\n}\n","import { purry } from '../function/purry';\n\nfunction hasImplementation<T>(data: Set<T>, value: T): boolean {\n return data.has(value);\n}\n\n/**\n * Returns whether a set contains a value.\n *\n * @example\n * ```ts\n * has(new Set([1, 2]), 1); // true\n * has(new Set([1, 2]), 3); // false\n * has(2)(new Set([1, 2])); // true\n * ```\n */\nexport function has<T>(value: T): (data: Set<T>) => Set<T>;\nexport function has<T>(data: Set<T>, value: T): Set<T>;\nexport function has(...args: readonly unknown[]): unknown {\n return purry(hasImplementation, args);\n}\n","import { purry } from '../function/purry';\n\nfunction intersectionImplementation<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T & U> {\n return data.intersection(other);\n}\n\n/**\n * Returns a new set containing values present in both sets.\n *\n * @example\n * ```ts\n * intersection(new Set([1, 2, 3]), new Set([2, 3, 4])); // Set(2) { 2, 3 }\n * intersection(new Set([2, 3, 4]))(new Set([1, 2, 3])); // Set(2) { 2, 3 }\n * ```\n */\nexport function intersection<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => Set<T & U>;\nexport function intersection<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T & U>;\nexport function intersection(...args: readonly unknown[]): unknown {\n return purry(intersectionImplementation, args);\n}\n","import { purry } from '../function/purry';\n\nfunction isDisjointFromImplementation<T, U>(data: Set<T>, other: ReadonlySetLike<U>): boolean {\n return data.isDisjointFrom(other);\n}\n\n/**\n * Returns whether two sets share no values.\n *\n * @example\n * ```ts\n * isDisjointFrom(new Set([1, 2]), new Set([3, 4])); // true\n * isDisjointFrom(new Set([1, 2]), new Set([2, 3])); // false\n * isDisjointFrom(new Set([2, 3]))(new Set([1, 2])); // false\n * ```\n */\nexport function isDisjointFrom<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => boolean;\nexport function isDisjointFrom<T, U>(data: Set<T>, other: ReadonlySetLike<U>): boolean;\nexport function isDisjointFrom(...args: readonly unknown[]): unknown {\n return purry(isDisjointFromImplementation, args);\n}\n","import { purry } from '../function/purry';\n\nfunction isSubsetOfImplementation<T, U>(data: Set<T>, other: ReadonlySetLike<U>): boolean {\n return data.isSubsetOf(other);\n}\n\n/**\n * Returns whether every value in the first set is contained in the second.\n *\n * @example\n * ```ts\n * isSubsetOf(new Set([1, 2]), new Set([1, 2, 3])); // true\n * isSubsetOf(new Set([1, 4]), new Set([1, 2, 3])); // false\n * isSubsetOf(new Set([1, 2, 3]))(new Set([1, 2])); // true\n * ```\n */\nexport function isSubsetOf<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => boolean;\nexport function isSubsetOf<T, U>(data: Set<T>, other: ReadonlySetLike<U>): boolean;\nexport function isSubsetOf(...args: readonly unknown[]): unknown {\n return purry(isSubsetOfImplementation, args);\n}\n","/**\n * Returns an iterator of a set's values.\n * For sets, keys and values are the same.\n *\n * @example\n * ```ts\n * [...keys(new Set([1, 2, 3]))]; // [1, 2, 3]\n * ```\n */\nexport function keys<T>(data: Set<T>): SetIterator<T> {\n return data.keys();\n}\n","import { purry } from '../function/purry';\n\nfunction removeImplementation<T>(data: Set<T>, value: T): Set<T> {\n data.delete(value);\n return data;\n}\n\n/**\n * Removes a value from a set and returns the same set.\n *\n * @example\n * ```ts\n * const set = new Set([1, 2, 3]);\n * remove(set, 2); // Set(2) { 1, 3 }\n * remove(3)(set); // Set(1) { 1 }\n * ```\n */\nexport function remove<T>(value: T): (data: Set<T>) => Set<T>;\nexport function remove<T>(data: Set<T>, value: T): Set<T>;\nexport function remove(...args: readonly unknown[]): unknown {\n return purry(removeImplementation, args);\n}\n","import { purry } from '../function/purry';\n\nfunction symmetricDifferenceImplementation<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T | U> {\n return data.symmetricDifference(other);\n}\n\n/**\n * Returns a new set containing values in either set but not both.\n *\n * @example\n * ```ts\n * symmetricDifference(new Set([1, 2, 3]), new Set([2, 3, 4])); // Set(2) { 1, 4 }\n * symmetricDifference(new Set([2, 3, 4]))(new Set([1, 2, 3])); // Set(2) { 1, 4 }\n * ```\n */\nexport function symmetricDifference<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => Set<T | U>;\nexport function symmetricDifference<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T | U>;\nexport function symmetricDifference(...args: readonly unknown[]): unknown {\n return purry(symmetricDifferenceImplementation, args);\n}\n","import { purry } from '../function/purry';\n\nfunction unionImplementation<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T | U> {\n return data.union(other);\n}\n\n/**\n * Returns a new set containing all values from both sets.\n *\n * @example\n * ```ts\n * union(new Set([1, 2]), new Set([2, 3])); // Set(3) { 1, 2, 3 }\n * union(new Set([2, 3]))(new Set([1, 2])); // Set(3) { 1, 2, 3 }\n * ```\n */\nexport function union<U>(other: ReadonlySetLike<U>): <T>(data: Set<T>) => Set<T | U>;\nexport function union<T, U>(data: Set<T>, other: ReadonlySetLike<U>): Set<T | U>;\nexport function union(...args: readonly unknown[]): unknown {\n return purry(unionImplementation, args);\n}\n","/**\n * Returns an iterator of a set's values.\n *\n * @example\n * ```ts\n * [...values(new Set([1, 2, 3]))]; // [1, 2, 3]\n * ```\n */\nexport function values<T>(data: Set<T>): SetIterator<T> {\n return data.values();\n}\n"],"mappings":";;;;;;AAIA,MAAa,OAAO;;;ACFpB,SAAS,kBAAqB,MAAc,OAAkB;CAC5D,OAAO,KAAK,IAAI,KAAK;AACvB;AAaA,SAAgB,IAAI,GAAG,MAAmC;CACxD,OAAO,MAAM,mBAAmB,IAAI;AACtC;;;;;;;;;;;ACXA,SAAgB,MAAS,MAAsB;CAC7C,KAAK,MAAM;CACX,OAAO;AACT;;;ACTA,SAAS,yBAA+B,MAAc,O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