@dereekb/util 13.11.13 → 13.11.15

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 (204) hide show
  1. package/eslint/index.cjs.js +10008 -394
  2. package/eslint/index.esm.js +9982 -392
  3. package/eslint/package.json +4 -4
  4. package/eslint/src/lib/comments.d.ts +14 -3
  5. package/eslint/src/lib/dbx-tag-families.d.ts +280 -0
  6. package/eslint/src/lib/index.d.ts +26 -3
  7. package/eslint/src/lib/jsdoc-parser.d.ts +116 -0
  8. package/eslint/src/lib/no-inline-string-empty-object-intersection.rule.d.ts +44 -0
  9. package/eslint/src/lib/no-inline-type-import.rule.d.ts +38 -0
  10. package/eslint/src/lib/no-sister-re-export.rule.d.ts +69 -0
  11. package/eslint/src/lib/plugin.d.ts +52 -1
  12. package/eslint/src/lib/prefer-canonical-jsdoc.rule.d.ts +68 -0
  13. package/eslint/src/lib/prefer-config-object.rule.d.ts +61 -0
  14. package/eslint/src/lib/prefer-maybe-type.rule.d.ts +72 -0
  15. package/eslint/src/lib/prefer-no-side-effects-in-jsdoc.rule.d.ts +1 -1
  16. package/eslint/src/lib/prefer-suggested-string.rule.d.ts +51 -0
  17. package/eslint/src/lib/require-constant-naming.rule.d.ts +63 -0
  18. package/eslint/src/lib/require-dbx-action-companion-tags.rule.d.ts +46 -0
  19. package/eslint/src/lib/require-dbx-auth-companion-tags.rule.d.ts +45 -0
  20. package/eslint/src/lib/require-dbx-docs-ui-example-companion-tags.rule.d.ts +42 -0
  21. package/eslint/src/lib/require-dbx-filter-companion-tags.rule.d.ts +43 -0
  22. package/eslint/src/lib/require-dbx-form-field-companion-tags.rule.d.ts +46 -0
  23. package/eslint/src/lib/require-dbx-model-companion-tags.rule.d.ts +46 -0
  24. package/eslint/src/lib/require-dbx-model-firebase-index-companion-tags.rule.d.ts +44 -0
  25. package/eslint/src/lib/require-dbx-model-snapshot-field-companion-tags.rule.d.ts +44 -0
  26. package/eslint/src/lib/require-dbx-pipe-companion-tags.rule.d.ts +43 -0
  27. package/eslint/src/lib/require-dbx-rule-companion-tags.rule.d.ts +44 -0
  28. package/eslint/src/lib/require-dbx-util-companion-tags.rule.d.ts +74 -0
  29. package/eslint/src/lib/require-dbx-web-companion-tags.rule.d.ts +43 -0
  30. package/eslint/src/lib/require-default-prefix-naming.rule.d.ts +60 -0
  31. package/eslint/src/lib/require-deprecated-alias-placement.rule.d.ts +75 -0
  32. package/eslint/src/lib/require-exported-jsdoc-example.rule.d.ts +61 -0
  33. package/eslint/src/lib/require-no-side-effects.rule.d.ts +1 -1
  34. package/eslint/src/lib/require-readonly-config-params.rule.d.ts +57 -0
  35. package/eslint/src/lib/require-single-return.rule.d.ts +42 -0
  36. package/fetch/index.cjs.js +95 -80
  37. package/fetch/index.esm.js +95 -80
  38. package/fetch/package.json +2 -2
  39. package/fetch/src/lib/error.d.ts +2 -2
  40. package/fetch/src/lib/fetch.d.ts +15 -15
  41. package/fetch/src/lib/fetch.file.d.ts +5 -5
  42. package/fetch/src/lib/fetch.limit.d.ts +2 -2
  43. package/fetch/src/lib/fetch.page.d.ts +1 -1
  44. package/fetch/src/lib/fetch.page.iterate.d.ts +4 -4
  45. package/fetch/src/lib/fetch.type.d.ts +3 -2
  46. package/fetch/src/lib/fetch.url.d.ts +13 -13
  47. package/fetch/src/lib/json.d.ts +12 -12
  48. package/fetch/src/lib/timeout.d.ts +2 -2
  49. package/fetch/src/lib/url.d.ts +11 -11
  50. package/index.cjs.js +2592 -2329
  51. package/index.esm.js +2590 -2327
  52. package/package.json +1 -1
  53. package/src/lib/array/array.boolean.d.ts +20 -20
  54. package/src/lib/array/array.d.ts +73 -72
  55. package/src/lib/array/array.factory.d.ts +8 -5
  56. package/src/lib/array/array.filter.d.ts +23 -20
  57. package/src/lib/array/array.find.d.ts +9 -8
  58. package/src/lib/array/array.index.d.ts +15 -14
  59. package/src/lib/array/array.indexed.d.ts +22 -19
  60. package/src/lib/array/array.make.d.ts +3 -2
  61. package/src/lib/array/array.map.d.ts +5 -5
  62. package/src/lib/array/array.number.d.ts +27 -27
  63. package/src/lib/array/array.random.d.ts +11 -10
  64. package/src/lib/array/array.set.d.ts +14 -14
  65. package/src/lib/array/array.string.d.ts +31 -31
  66. package/src/lib/array/array.unique.d.ts +22 -20
  67. package/src/lib/array/array.value.d.ts +3 -2
  68. package/src/lib/assertion/assert.error.d.ts +8 -8
  69. package/src/lib/assertion/assertion.d.ts +5 -5
  70. package/src/lib/assertion/assertion.generic.d.ts +3 -3
  71. package/src/lib/assertion/assertion.number.d.ts +6 -6
  72. package/src/lib/auth/auth.role.claims.d.ts +12 -11
  73. package/src/lib/auth/auth.role.d.ts +3 -3
  74. package/src/lib/auth/pkce.d.ts +2 -2
  75. package/src/lib/boolean.d.ts +11 -11
  76. package/src/lib/cache/cache.memoize.d.ts +6 -6
  77. package/src/lib/contact/domain.d.ts +9 -9
  78. package/src/lib/contact/email.d.ts +11 -11
  79. package/src/lib/contact/phone.d.ts +12 -12
  80. package/src/lib/contact/random.d.ts +11 -9
  81. package/src/lib/date/date.d.ts +60 -59
  82. package/src/lib/date/date.time.d.ts +2 -2
  83. package/src/lib/date/date.unix.d.ts +8 -8
  84. package/src/lib/date/duration.d.ts +17 -17
  85. package/src/lib/date/expires.d.ts +29 -27
  86. package/src/lib/date/hour.d.ts +23 -23
  87. package/src/lib/date/minute.d.ts +6 -6
  88. package/src/lib/date/time.d.ts +10 -9
  89. package/src/lib/date/week.d.ts +32 -31
  90. package/src/lib/encryption/encryption.object.d.ts +3 -3
  91. package/src/lib/error/error.d.ts +13 -12
  92. package/src/lib/error/error.server.d.ts +4 -4
  93. package/src/lib/file/pdf.d.ts +4 -4
  94. package/src/lib/filter/filter.d.ts +3 -2
  95. package/src/lib/function/function.boolean.d.ts +4 -3
  96. package/src/lib/function/function.forward.d.ts +6 -4
  97. package/src/lib/getter/getter.d.ts +24 -19
  98. package/src/lib/getter/getter.map.d.ts +6 -5
  99. package/src/lib/getter/getter.util.d.ts +3 -2
  100. package/src/lib/grouping.d.ts +25 -24
  101. package/src/lib/hash.d.ts +11 -10
  102. package/src/lib/iterable/iterable.d.ts +39 -39
  103. package/src/lib/iterable/iterable.map.d.ts +3 -3
  104. package/src/lib/key.d.ts +16 -16
  105. package/src/lib/map/map.d.ts +12 -12
  106. package/src/lib/map/map.intersection.d.ts +3 -3
  107. package/src/lib/map/map.key.d.ts +16 -14
  108. package/src/lib/misc/host.d.ts +2 -2
  109. package/src/lib/model/id.batch.d.ts +4 -3
  110. package/src/lib/model/id.factory.d.ts +4 -3
  111. package/src/lib/model/model.conversion.d.ts +19 -14
  112. package/src/lib/model/model.conversion.field.d.ts +2 -2
  113. package/src/lib/model/model.copy.d.ts +5 -4
  114. package/src/lib/model/model.d.ts +48 -46
  115. package/src/lib/model/model.modify.d.ts +10 -8
  116. package/src/lib/nodejs/stream.d.ts +6 -5
  117. package/src/lib/number/bitwise.dencoder.d.ts +12 -12
  118. package/src/lib/number/bound.d.ts +16 -13
  119. package/src/lib/number/dollar.d.ts +6 -5
  120. package/src/lib/number/encoded.d.ts +7 -7
  121. package/src/lib/number/factory.d.ts +4 -3
  122. package/src/lib/number/number.d.ts +37 -37
  123. package/src/lib/number/random.d.ts +11 -10
  124. package/src/lib/number/round.d.ts +34 -30
  125. package/src/lib/number/sort.d.ts +3 -2
  126. package/src/lib/number/transform.d.ts +5 -4
  127. package/src/lib/object/object.array.d.ts +6 -6
  128. package/src/lib/object/object.array.delta.d.ts +3 -2
  129. package/src/lib/object/object.d.ts +12 -12
  130. package/src/lib/object/object.empty.d.ts +3 -3
  131. package/src/lib/object/object.equal.d.ts +11 -10
  132. package/src/lib/object/object.filter.pojo.d.ts +74 -74
  133. package/src/lib/object/object.filter.tuple.d.ts +26 -26
  134. package/src/lib/object/object.flatten.d.ts +4 -4
  135. package/src/lib/object/object.key.d.ts +6 -4
  136. package/src/lib/object/object.map.d.ts +15 -13
  137. package/src/lib/page/page.d.ts +5 -5
  138. package/src/lib/page/page.filter.d.ts +8 -8
  139. package/src/lib/path/path.d.ts +98 -88
  140. package/src/lib/promise/callback.d.ts +2 -2
  141. package/src/lib/promise/is.d.ts +6 -6
  142. package/src/lib/promise/poll.d.ts +9 -9
  143. package/src/lib/promise/promise.d.ts +33 -30
  144. package/src/lib/promise/promise.factory.d.ts +4 -3
  145. package/src/lib/promise/promise.loop.d.ts +11 -11
  146. package/src/lib/promise/promise.task.d.ts +6 -5
  147. package/src/lib/promise/promise.type.d.ts +3 -3
  148. package/src/lib/promise/use.d.ts +3 -3
  149. package/src/lib/relation/relation.d.ts +15 -15
  150. package/src/lib/service/handler.config.d.ts +20 -16
  151. package/src/lib/service/handler.d.ts +3 -2
  152. package/src/lib/service/typed.service.d.ts +2 -2
  153. package/src/lib/set/set.d.ts +62 -59
  154. package/src/lib/set/set.delta.d.ts +5 -4
  155. package/src/lib/set/set.hashset.d.ts +5 -5
  156. package/src/lib/set/set.selection.d.ts +5 -4
  157. package/src/lib/sort.d.ts +11 -11
  158. package/src/lib/storage/storage.d.ts +2 -1
  159. package/src/lib/storage/storage.error.d.ts +4 -4
  160. package/src/lib/storage/storage.memory.d.ts +7 -7
  161. package/src/lib/storage/storage.object.d.ts +5 -5
  162. package/src/lib/string/case.d.ts +6 -6
  163. package/src/lib/string/char.d.ts +30 -29
  164. package/src/lib/string/dencoder.d.ts +25 -20
  165. package/src/lib/string/factory.d.ts +11 -8
  166. package/src/lib/string/html.d.ts +19 -19
  167. package/src/lib/string/mimetype.d.ts +9 -8
  168. package/src/lib/string/prefix.d.ts +8 -8
  169. package/src/lib/string/replace.d.ts +45 -39
  170. package/src/lib/string/search.d.ts +5 -4
  171. package/src/lib/string/sort.d.ts +13 -4
  172. package/src/lib/string/string.d.ts +44 -43
  173. package/src/lib/string/transform.d.ts +32 -23
  174. package/src/lib/string/tree.d.ts +5 -4
  175. package/src/lib/string/url.d.ts +5 -4
  176. package/src/lib/tree/tree.array.d.ts +5 -4
  177. package/src/lib/tree/tree.expand.d.ts +6 -6
  178. package/src/lib/tree/tree.explore.d.ts +13 -10
  179. package/src/lib/tree/tree.flatten.d.ts +10 -10
  180. package/src/lib/type.d.ts +42 -12
  181. package/src/lib/value/address.d.ts +7 -7
  182. package/src/lib/value/bound.d.ts +70 -66
  183. package/src/lib/value/build.d.ts +6 -6
  184. package/src/lib/value/comparator.d.ts +19 -17
  185. package/src/lib/value/cron.d.ts +2 -2
  186. package/src/lib/value/decision.d.ts +6 -5
  187. package/src/lib/value/equal.d.ts +11 -9
  188. package/src/lib/value/indexed.d.ts +101 -85
  189. package/src/lib/value/label.d.ts +2 -2
  190. package/src/lib/value/map.d.ts +20 -16
  191. package/src/lib/value/maybe.d.ts +36 -36
  192. package/src/lib/value/modifier.d.ts +24 -23
  193. package/src/lib/value/point.d.ts +85 -77
  194. package/src/lib/value/url.d.ts +2 -2
  195. package/src/lib/value/use.d.ts +36 -33
  196. package/src/lib/value/vector.d.ts +15 -14
  197. package/test/index.cjs.js +41 -36
  198. package/test/index.esm.js +41 -36
  199. package/test/package.json +2 -2
  200. package/test/src/lib/jest/jest.fail.d.ts +2 -2
  201. package/test/src/lib/shared/shared.d.ts +20 -20
  202. package/test/src/lib/shared/shared.fail.d.ts +21 -16
  203. package/test/src/lib/shared/shared.function.d.ts +4 -4
  204. package/test/src/lib/shared/shared.wrap.d.ts +10 -10
@@ -11,20 +11,20 @@ export type AllOrNoneSelection = 'all' | 'none';
11
11
  /**
12
12
  * Converts an {@link IterableOrValue} into a Set. Strings are treated as single values rather than character iterables.
13
13
  *
14
+ * @param values - The value or iterable to convert.
15
+ * @returns A new Set containing all values.
16
+ *
14
17
  * @dbxUtil
15
18
  * @dbxUtilCategory set
16
19
  * @dbxUtilTags set, convert, normalize, ensure, unique, dedupe
17
20
  * @dbxUtilRelated add-to-set, iterable-to-set
18
- *
19
- * @param values - The value or iterable to convert.
20
- * @returns A new Set containing all values.
21
21
  */
22
22
  export declare function asSet<T>(values: IterableOrValue<T>): Set<T>;
23
23
  /**
24
24
  * Creates a copy of the set, applies the given function to the copy, and returns it.
25
25
  *
26
26
  * @param set - The set to copy, or null/undefined for an empty set.
27
- * @param fn - A function to mutate the copied set.
27
+ * @param fn - Used to mutate the copied set.
28
28
  * @returns The modified copy of the set.
29
29
  */
30
30
  export declare function copySetAndDo<T>(set: Maybe<Set<T>>, fn: (set: Set<T>) => void): Set<T>;
@@ -39,13 +39,13 @@ export declare function addToSetCopy<T>(set: Maybe<Set<T>>, values: Maybe<Iterab
39
39
  /**
40
40
  * Adds one or more values to the given set in place.
41
41
  *
42
+ * @param set - The set to add values to.
43
+ * @param values - The value or iterable of values to add.
44
+ *
42
45
  * @dbxUtil
43
46
  * @dbxUtilCategory set
44
47
  * @dbxUtilTags set, add, mutate, insert, in-place
45
48
  * @dbxUtilRelated add-to-set-copy, remove-from-set, toggle-in-set
46
- *
47
- * @param set - The set to add values to.
48
- * @param values - The value or iterable of values to add.
49
49
  */
50
50
  export declare function addToSet<T>(set: Set<T>, values: Maybe<IterableOrValue<T>>): void;
51
51
  /**
@@ -59,13 +59,13 @@ export declare function toggleInSetCopy<T>(set: Set<T>, values: Maybe<IterableOr
59
59
  /**
60
60
  * Toggles values in the set in place: adds if absent, removes if present.
61
61
  *
62
+ * @param set - The set to modify.
63
+ * @param values - The values to toggle.
64
+ *
62
65
  * @dbxUtil
63
66
  * @dbxUtilCategory set
64
67
  * @dbxUtilTags set, toggle, add, remove, mutate, in-place
65
68
  * @dbxUtilRelated toggle-in-set-copy, add-to-set, remove-from-set
66
- *
67
- * @param set - The set to modify.
68
- * @param values - The values to toggle.
69
69
  */
70
70
  export declare function toggleInSet<T>(set: Set<T>, values: Maybe<IterableOrValue<T>>): void;
71
71
  /**
@@ -104,7 +104,7 @@ export declare function hasDifferentValues<T>(a: Maybe<Iterable<T>>, b: Maybe<It
104
104
  *
105
105
  * @param a - First iterable.
106
106
  * @param b - Second iterable.
107
- * @returns An array of values present in only one of the inputs.
107
+ * @returns The values present in only one of the inputs.
108
108
  */
109
109
  export declare function symmetricDifferenceArray<T>(a: Maybe<Iterable<T>>, b: Maybe<Iterable<T>>): Maybe<T>[];
110
110
  /**
@@ -112,14 +112,14 @@ export declare function symmetricDifferenceArray<T>(a: Maybe<Iterable<T>>, b: Ma
112
112
  *
113
113
  * @param a - First set.
114
114
  * @param b - Second set.
115
- * @returns An array of values present in only one of the sets.
115
+ * @returns The values present in only one of the sets.
116
116
  */
117
117
  export declare function symmetricDifferenceArrayBetweenSets<T>(a: Set<Maybe<T>>, b: Set<Maybe<T>>): Maybe<T>[];
118
118
  /**
119
119
  * Flattens a two-dimensional array into a Set of unique values.
120
120
  *
121
121
  * @param array - The nested array to flatten.
122
- * @returns A Set containing all values from the nested arrays.
122
+ * @returns Set of unique values pulled from every nested array.
123
123
  */
124
124
  export declare function flattenArrayToSet<T>(array: T[][]): Set<T>;
125
125
  /**
@@ -128,7 +128,7 @@ export declare function flattenArrayToSet<T>(array: T[][]): Set<T>;
128
128
  *
129
129
  * @param set - The reference set to check membership against.
130
130
  * @param values - The values to filter.
131
- * @returns A Set of values that exist in both inputs.
131
+ * @returns Intersection between the input values and the reference set.
132
132
  */
133
133
  export declare function keepFromSetCopy<T>(set: Set<T>, values: Maybe<IterableOrValue<T>>): Set<T>;
134
134
  /**
@@ -136,7 +136,7 @@ export declare function keepFromSetCopy<T>(set: Set<T>, values: Maybe<IterableOr
136
136
  *
137
137
  * @param values - The array to filter.
138
138
  * @param set - The set to check membership against.
139
- * @returns An array of values present in the set.
139
+ * @returns The values present in the set.
140
140
  */
141
141
  export declare function keepValuesFromSet<T>(values: T[], set: Set<T>): T[];
142
142
  /**
@@ -144,7 +144,7 @@ export declare function keepValuesFromSet<T>(values: T[], set: Set<T>): T[];
144
144
  *
145
145
  * @param valuesToExclude - The array of values to filter.
146
146
  * @param iterable - The iterable of values to exclude.
147
- * @returns An array of values not found in the iterable.
147
+ * @returns The values not found in the iterable.
148
148
  */
149
149
  export declare function excludeValues<T>(valuesToExclude: T[], iterable: Maybe<Iterable<T>>): T[];
150
150
  /**
@@ -152,7 +152,7 @@ export declare function excludeValues<T>(valuesToExclude: T[], iterable: Maybe<I
152
152
  *
153
153
  * @param values - The array to filter.
154
154
  * @param set - The set of values to exclude.
155
- * @returns An array of values not in the set.
155
+ * @returns The values not in the set.
156
156
  */
157
157
  export declare function excludeValuesFromSet<T>(values: T[], set: Set<T>): T[];
158
158
  /**
@@ -169,7 +169,7 @@ export declare function filterValuesUsingSet<T>(values: T[], set: Set<T>, exclud
169
169
  *
170
170
  * @param values - The iterable to filter.
171
171
  * @param fn - The decision function that determines inclusion.
172
- * @returns A Set of values that passed the filter.
172
+ * @returns Set of values for which `fn` returned `true`.
173
173
  */
174
174
  export declare function filterValuesToSet<T>(values: Iterable<T>, fn: DecisionFunction<T>): Set<T>;
175
175
  /**
@@ -198,21 +198,22 @@ export declare function separateValuesToSets<T>(values: Iterable<T>, fn: Decisio
198
198
  *
199
199
  * @param values - The iterable to map.
200
200
  * @param mapFn - The mapping function.
201
- * @returns A Set of mapped values.
201
+ * @returns Mapped values collected into a Set (duplicates collapse).
202
202
  */
203
203
  export declare function mapValuesToSet<I, O>(values: Iterable<I>, mapFn: MapFunction<I, O>): Set<O>;
204
204
  /**
205
205
  * Creates a {@link SetHasValueFunction} from an {@link IterableOrValue} by first converting it to a Set.
206
206
  *
207
+ * @param iterable - The values to create a set from.
208
+ * @param exclude - If true, the returned function returns true for values NOT in the set.
209
+ * @returns Tests membership.
210
+ *
207
211
  * @dbxUtil
208
212
  * @dbxUtilCategory set
209
213
  * @dbxUtilKind factory
210
214
  * @dbxUtilTags set, has, decision, factory, membership, exclude
211
215
  * @dbxUtilRelated set-has-value-function, set-includes-function
212
216
  *
213
- * @param iterable - The values to create a set from.
214
- * @param exclude - If true, the returned function returns true for values NOT in the set.
215
- * @returns A function that tests membership.
216
217
  * @__NO_SIDE_EFFECTS__
217
218
  */
218
219
  export declare function hasValueFunction<T>(iterable: IterableOrValue<T>, exclude?: boolean): SetHasValueFunction<T>;
@@ -223,15 +224,16 @@ export type SetHasValueFunction<T> = (value: T) => boolean;
223
224
  /**
224
225
  * Creates a {@link SetHasValueFunction} for the given set. When `exclude` is true, returns the inverse (true for values not in the set).
225
226
  *
227
+ * @param set - The set to check against.
228
+ * @param exclude - If true, returns true for values NOT in the set.
229
+ * @returns Tests membership.
230
+ *
226
231
  * @dbxUtil
227
232
  * @dbxUtilCategory set
228
233
  * @dbxUtilKind factory
229
234
  * @dbxUtilTags set, has, decision, factory, membership, exclude
230
235
  * @dbxUtilRelated has-value-function, set-includes-function
231
236
  *
232
- * @param set - The set to check against.
233
- * @param exclude - If true, returns true for values NOT in the set.
234
- * @returns A function that tests membership.
235
237
  * @__NO_SIDE_EFFECTS__
236
238
  */
237
239
  export declare function setHasValueFunction<T>(set: Set<T>, exclude: boolean): SetHasValueFunction<T>;
@@ -277,16 +279,17 @@ export type SetIncludesFunction<T> = (valuesToFind: IterableOrValue<T>) => boole
277
279
  /**
278
280
  * Creates a {@link SetIncludesFunction} that checks whether the set includes given values using the specified mode.
279
281
  *
282
+ * @param valuesSet - The reference set.
283
+ * @param mode - Whether to require 'all' values or 'any' value to be present. Defaults to 'all'.
284
+ * @param emptyValuesToFindArrayResult - The result when the values to find are empty.
285
+ * @returns Tests inclusion against the set.
286
+ *
280
287
  * @dbxUtil
281
288
  * @dbxUtilCategory set
282
289
  * @dbxUtilKind factory
283
290
  * @dbxUtilTags set, includes, decision, factory, all, any, mode
284
291
  * @dbxUtilRelated has-value-function, set-has-value-function
285
292
  *
286
- * @param valuesSet - The reference set.
287
- * @param mode - Whether to require 'all' values or 'any' value to be present. Defaults to 'all'.
288
- * @param emptyValuesToFindArrayResult - The result when the values to find are empty.
289
- * @returns A function that tests inclusion against the set.
290
293
  * @__NO_SIDE_EFFECTS__
291
294
  */
292
295
  export declare function setIncludesFunction<T>(valuesSet: Set<T>, mode?: SetIncludesMode, emptyValuesToFindArrayResult?: boolean): SetIncludesFunction<T>;
@@ -303,10 +306,10 @@ export declare function setIncludes<T>(valuesSet: Set<T>, valuesToFind: Iterable
303
306
  /**
304
307
  * Returns false if the input array contains any value from the second array.
305
308
  *
306
- * @param values - the values to check against
307
- * @param valuesToFind - the values to look for
308
- * @param emptyValuesToFindArrayResult - result when valuesToFind is empty
309
- * @returns `true` if none of the valuesToFind are present in values
309
+ * @param values - The values to check against.
310
+ * @param valuesToFind - The values to look for.
311
+ * @param emptyValuesToFindArrayResult - Result when valuesToFind is empty.
312
+ * @returns `true` if none of the valuesToFind are present in values.
310
313
  */
311
314
  export declare function containsNoneOfValue<T>(values: IterableOrValue<T>, valuesToFind: IterableOrValue<T>, emptyValuesToFindArrayResult?: boolean): boolean;
312
315
  /**
@@ -332,10 +335,10 @@ export declare function setContainsNoneOfValue<T>(valuesSet: Set<T>, valuesToFin
332
335
  *
333
336
  * If valuesToFind is empty, returns the emptyValuesToFindArrayResult value. Defaults to false.
334
337
  *
335
- * @param values - the values to build a set from and check against
336
- * @param valuesToFind - the values to search for within the set
337
- * @param emptyValuesToFindArrayResult - result when valuesToFind is empty; defaults to false
338
- * @returns `true` if any of the valuesToFind exist in values
338
+ * @param values - The values to build a set from and check against.
339
+ * @param valuesToFind - The values to search for within the set.
340
+ * @param emptyValuesToFindArrayResult - Result when valuesToFind is empty; defaults to false.
341
+ * @returns `true` if any of the valuesToFind exist in values.
339
342
  */
340
343
  export declare function containsAnyValue<T>(values: IterableOrValue<T>, valuesToFind: IterableOrValue<T>, emptyValuesToFindArrayResult?: boolean): boolean;
341
344
  /**
@@ -343,10 +346,10 @@ export declare function containsAnyValue<T>(values: IterableOrValue<T>, valuesTo
343
346
  *
344
347
  * If values is empty, returns the emptyValuesToFindArrayResult value. Defaults to false.
345
348
  *
346
- * @param values - the values to check for membership in the set
347
- * @param valuesToFind - the set to check against
348
- * @param emptyValuesArrayResult - result when values is empty; defaults to false
349
- * @returns `true` if any of the values are present in the set
349
+ * @param values - The values to check for membership in the set.
350
+ * @param valuesToFind - The set to check against.
351
+ * @param emptyValuesArrayResult - Result when values is empty; defaults to false.
352
+ * @returns `true` if any of the values are present in the set.
350
353
  */
351
354
  export declare function containsAnyValueFromSet<T>(values: IterableOrValue<T>, valuesToFind: Set<T>, emptyValuesArrayResult?: boolean): boolean;
352
355
  /**
@@ -354,10 +357,10 @@ export declare function containsAnyValueFromSet<T>(values: IterableOrValue<T>, v
354
357
  *
355
358
  * If valuesToFind is empty, returns the emptyValuesToFindArrayResult value. Defaults to false.
356
359
  *
357
- * @param valuesSet - the set to check for membership
358
- * @param valuesToFind - the values to search for in the set
359
- * @param emptyValuesToFindArrayResult - result when valuesToFind is empty; defaults to false
360
- * @returns `true` if any of the valuesToFind are present in the set
360
+ * @param valuesSet - The set to check for membership.
361
+ * @param valuesToFind - The values to search for in the set.
362
+ * @param emptyValuesToFindArrayResult - Result when valuesToFind is empty; defaults to false.
363
+ * @returns `true` if any of the valuesToFind are present in the set.
361
364
  */
362
365
  export declare function setContainsAnyValue<T>(valuesSet: Set<T>, valuesToFind: IterableOrValue<T>, emptyValuesToFindArrayResult?: boolean): boolean;
363
366
  /**
@@ -365,10 +368,10 @@ export declare function setContainsAnyValue<T>(valuesSet: Set<T>, valuesToFind:
365
368
  *
366
369
  * If valuesToFind is empty, returns the emptyValuesToFindArrayResult value. Defaults to true.
367
370
  *
368
- * @param values - the iterable of values to build a set from
369
- * @param valuesToFind - the values that must all be present
370
- * @param emptyValuesArrayResult - result when valuesToFind is empty; defaults to true
371
- * @returns `true` if all valuesToFind are present in the values set
371
+ * @param values - The iterable of values to build a set from.
372
+ * @param valuesToFind - The values that must all be present.
373
+ * @param emptyValuesArrayResult - Result when valuesToFind is empty; defaults to true.
374
+ * @returns `true` if all valuesToFind are present in the values set.
372
375
  */
373
376
  export declare function containsAllValues<T>(values: Iterable<T>, valuesToFind: IterableOrValue<T>, emptyValuesArrayResult?: boolean): boolean;
374
377
  /**
@@ -376,25 +379,25 @@ export declare function containsAllValues<T>(values: Iterable<T>, valuesToFind:
376
379
  *
377
380
  * If valuesToFind is empty, returns the emptyValuesToFindArrayResult value. Defaults to true.
378
381
  *
379
- * @param valuesSet - the set to check for full containment
380
- * @param valuesToFind - the values that must all be present in the set
381
- * @param emptyValuesToFindArrayResult - result when valuesToFind is empty; defaults to true
382
- * @returns `true` if every value in valuesToFind is present in the set
382
+ * @param valuesSet - The set to check for full containment.
383
+ * @param valuesToFind - The values that must all be present in the set.
384
+ * @param emptyValuesToFindArrayResult - Result when valuesToFind is empty; defaults to true.
385
+ * @returns `true` if every value in valuesToFind is present in the set.
383
386
  */
384
387
  export declare function setContainsAllValues<T>(valuesSet: Set<T>, valuesToFind: IterableOrValue<T>, emptyValuesToFindArrayResult?: boolean): boolean;
385
388
  /**
386
389
  * Returns true if both iterables are defined (or are both null/undefined) and have the same values exactly.
387
390
  *
388
- * @param a - first iterable to compare
389
- * @param b - second iterable to compare
390
- * @returns `true` if both iterables contain the same unique values, or both are nullish
391
+ * @param a - First iterable to compare.
392
+ * @param b - Second iterable to compare.
393
+ * @returns `true` if both iterables contain the same unique values, or both are nullish.
391
394
  */
392
395
  export declare function iterablesAreSetEquivalent<T>(a: Maybe<Iterable<T>>, b: Maybe<Iterable<T>>): boolean;
393
396
  /**
394
397
  * Returns true if both sets are defined (or are both null/undefined) and have the same values exactly.
395
398
  *
396
- * @param a - first set to compare
397
- * @param b - second set to compare
398
- * @returns `true` if both sets contain the same values, or both are nullish
399
+ * @param a - First set to compare.
400
+ * @param b - Second set to compare.
401
+ * @returns `true` if both sets contain the same values, or both are nullish.
399
402
  */
400
403
  export declare function setsAreEquivalent<T>(a: Maybe<Set<T>>, b: Maybe<Set<T>>): boolean;
@@ -51,24 +51,25 @@ export interface SetDeltaFunctionConfig<T, K extends PrimativeKey = PrimativeKey
51
51
  /**
52
52
  * Reads the identifying key from each input value.
53
53
  */
54
- readKey: ReadKeyFunction<T, K>;
54
+ readonly readKey: ReadKeyFunction<T, K>;
55
55
  /**
56
56
  * Whether or not the value is modified.
57
57
  */
58
- isModifiedFunction?: SetValueIsModifiedFunction<T>;
58
+ readonly isModifiedFunction?: SetValueIsModifiedFunction<T>;
59
59
  }
60
60
  /**
61
61
  * Creates a {@link SetDeltaFunction} that computes the differences between two iterables,
62
62
  * identifying which items were added, removed, or unchanged.
63
63
  *
64
+ * @param config - Configuration with the key reader and optional modification detector.
65
+ * @returns Compares two iterables and returns an array of change pairs.
66
+ *
64
67
  * @dbxUtil
65
68
  * @dbxUtilCategory set
66
69
  * @dbxUtilKind factory
67
70
  * @dbxUtilTags set, delta, diff, factory, change, added, removed
68
71
  * @dbxUtilRelated index-delta-group-function, set-has-value-function
69
72
  *
70
- * @param config - Configuration with the key reader and optional modification detector.
71
- * @returns A function that compares two iterables and returns an array of change pairs.
72
73
  * @__NO_SIDE_EFFECTS__
73
74
  */
74
75
  export declare function setDeltaFunction<T>(config: SetDeltaFunctionConfig<T>): SetDeltaFunction<T>;
@@ -7,7 +7,7 @@ export interface HashSetConfig<K extends PrimativeKey, T> {
7
7
  /**
8
8
  * Extracts the unique key used for equality comparison from each value.
9
9
  */
10
- readKey: ReadKeyFunction<T, K>;
10
+ readonly readKey: ReadKeyFunction<T, K>;
11
11
  }
12
12
  /**
13
13
  * Set that is implemented internally using a Map, and input values have their keys read.
@@ -49,19 +49,19 @@ export declare class HashSet<K extends PrimativeKey, T> implements Set<T> {
49
49
  * @param key - The key to look up.
50
50
  * @returns The value, or undefined.
51
51
  */
52
- valueForKey(key: Maybe<K>): T | undefined;
52
+ valueForKey(key: Maybe<K>): Maybe<T>;
53
53
  /**
54
54
  * Returns key-value entry pairs for each of the given keys. Missing values appear as undefined.
55
55
  *
56
56
  * @param keys - The keys to look up.
57
- * @returns An array of [key, value] tuples.
57
+ * @returns Array of [key, value] tuples.
58
58
  */
59
59
  valueKeyEntriesForKeys(keys: Maybe<K>[]): [Maybe<K>, Maybe<T>][];
60
60
  /**
61
61
  * Returns the values associated with the given keys, omitting keys that have no value.
62
62
  *
63
63
  * @param keys - The keys to look up.
64
- * @returns An array of found values.
64
+ * @returns The found values.
65
65
  */
66
66
  valuesForKeys(keys: Maybe<K>[]): T[];
67
67
  forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: unknown): void;
@@ -71,7 +71,7 @@ export declare class HashSet<K extends PrimativeKey, T> implements Set<T> {
71
71
  /**
72
72
  * Returns all values in the set as an array.
73
73
  *
74
- * @returns An array of all stored values.
74
+ * @returns The all stored values.
75
75
  */
76
76
  valuesArray(): T[];
77
77
  get [Symbol.toStringTag](): string;
@@ -11,26 +11,27 @@ export interface IsSelectedDecisionFunctionConfig<T, K extends PrimativeKey = Pr
11
11
  /**
12
12
  * Reads the key from the input value.
13
13
  */
14
- readKey: ReadKeyFunction<T, K>;
14
+ readonly readKey: ReadKeyFunction<T, K>;
15
15
  /**
16
16
  * Default value to use if readKey returns no key.
17
17
  *
18
18
  * Defaults to false.
19
19
  */
20
- defaultIfKeyNull?: boolean;
20
+ readonly defaultIfKeyNull?: boolean;
21
21
  }
22
22
  /**
23
23
  * Creates an {@link IsSelectedDecisionFunctionFactory} that produces decision functions
24
24
  * checking whether a value's key is included in a set of selected values.
25
25
  *
26
+ * @param config - Configuration with the key reader and default behavior.
27
+ * @returns A factory that creates decision functions from a set of selected keys.
28
+ *
26
29
  * @dbxUtil
27
30
  * @dbxUtilCategory set
28
31
  * @dbxUtilKind factory
29
32
  * @dbxUtilTags set, selection, decision, predicate, factory, key
30
33
  * @dbxUtilRelated is-in-set-decision-function
31
34
  *
32
- * @param config - Configuration with the key reader and default behavior.
33
- * @returns A factory that creates decision functions from a set of selected keys.
34
35
  * @__NO_SIDE_EFFECTS__
35
36
  */
36
37
  export declare function isSelectedDecisionFunctionFactory<T, K extends PrimativeKey = PrimativeKey>(config: IsSelectedDecisionFunctionConfig<T, K>): IsSelectedDecisionFunctionFactory<T, K>;
package/src/lib/sort.d.ts CHANGED
@@ -5,7 +5,7 @@ export declare const SORT_VALUE_LESS_THAN: SortComparisonNumber;
5
5
  export declare const SORT_VALUE_GREATER_THAN: SortComparisonNumber;
6
6
  export declare const SORT_VALUE_EQUAL: SortComparisonNumber;
7
7
  /**
8
- * A number that is the result of comparison two items.
8
+ * Is the result of comparison two items.
9
9
  *
10
10
  * In "ascending" order, a value:
11
11
  * - smaller than another will return -1 (or less).
@@ -59,14 +59,14 @@ export declare function reverseCompareFn<T>(compareFn: SortDescendingCompareFunc
59
59
  *
60
60
  * The input comparison function must be in ascending order.
61
61
  *
62
+ * @param ascendingCompareFn - A comparison function that sorts in ascending order.
63
+ * @param order - The desired sort direction; defaults to 'asc'.
64
+ * @returns The original function if ascending, or a reversed version if descending.
65
+ *
62
66
  * @dbxUtil
63
67
  * @dbxUtilCategory sort
64
68
  * @dbxUtilTags sort, order, ascending, descending, compare, direction
65
69
  * @dbxUtilRelated reverse-compare-fn, compare-with-mapped-values-function
66
- *
67
- * @param ascendingCompareFn - a comparison function that sorts in ascending order
68
- * @param order - the desired sort direction; defaults to 'asc'
69
- * @returns the original function if ascending, or a reversed version if descending
70
70
  */
71
71
  export declare function compareFnOrder<T>(ascendingCompareFn: AscendingSortCompareFunction<T>, order?: SortingOrder): SortCompareFunction<T>;
72
72
  /**
@@ -132,15 +132,15 @@ export declare function sortValues<T>(input: SortValuesInput<T>): T[];
132
132
  *
133
133
  * @param sortRef - Reference containing the sort comparison function.
134
134
  * @param sortOnCopyDefault - Whether to sort on a copy by default (default: true).
135
- * @returns A function that sorts arrays using the configured comparison.
135
+ * @returns Sorts arrays using the configured comparison.
136
136
  */
137
137
  export declare function sortValuesFunctionWithSortRef<T>(sortRef: Maybe<Partial<SortCompareFunctionRef<T>>>, sortOnCopyDefault?: boolean): SortValuesFunction<T>;
138
138
  /**
139
139
  * Creates a SortValuesFunction using the input. If the input is not defined, or it's sort function is not defined, then returns mapIdentityFunction().
140
140
  *
141
- * @param sortRef - optional reference containing the sort comparison function
142
- * @param sortOnCopyDefault - whether to sort on a copy by default
143
- * @returns a sort function that sorts arrays, or the identity function if no sort comparison is configured
141
+ * @param sortRef - Optional reference containing the sort comparison function.
142
+ * @param sortOnCopyDefault - Whether to sort on a copy by default.
143
+ * @returns A sort function that sorts arrays, or the identity function if no sort comparison is configured.
144
144
  */
145
145
  export declare function sortValuesFunctionOrMapIdentityWithSortRef<T>(sortRef: Maybe<Partial<SortCompareFunctionRef<T>>>, sortOnCopyDefault?: boolean): SortValuesFunction<T>;
146
146
  /**
@@ -155,7 +155,7 @@ export interface MinAndMax<T> {
155
155
  min: T;
156
156
  max: T;
157
157
  }
158
- export type MinAndMaxFunctionResult<T> = MinAndMax<T> | null;
158
+ export type MinAndMaxFunctionResult<T> = Maybe<MinAndMax<T>>;
159
159
  /**
160
160
  * Returns the min and maximum value from the input values.
161
161
  *
@@ -166,7 +166,7 @@ export type MinAndMaxFunction<T> = (values: Iterable<T>) => MinAndMaxFunctionRes
166
166
  * Creates a {@link MinAndMaxFunction} that finds the minimum and maximum values from an iterable using the provided comparison function.
167
167
  *
168
168
  * @param compareFn - Ascending sort comparison function used to determine min/max.
169
- * @returns A function that returns `{ min, max }` or `null` for empty iterables.
169
+ * @returns Returns `{ min, max }` or `null` for empty iterables.
170
170
  *
171
171
  * @dbxUtil
172
172
  * @dbxUtilCategory sort
@@ -1,3 +1,4 @@
1
+ import { type Maybe } from '../value/maybe.type';
1
2
  import { type UnixDateTimeMillisecondsNumber } from '../date/date';
2
3
  /**
3
4
  * String representation of data that is stored.
@@ -24,7 +25,7 @@ export interface StoredData {
24
25
  * The Unix timestamp (in milliseconds) when the data was stored.
25
26
  * Undefined if the storage time is not known or not applicable.
26
27
  */
27
- readonly storedAt: UnixDateTimeMillisecondsNumber | undefined;
28
+ readonly storedAt: Maybe<UnixDateTimeMillisecondsNumber>;
28
29
  /**
29
30
  * The actual data stored, as a string.
30
31
  */
@@ -7,7 +7,7 @@ export declare class StoredDataError extends BaseError {
7
7
  /**
8
8
  * Creates an instance of StoredDataError.
9
9
  *
10
- * @param message Optional error message.
10
+ * @param message - Optional error message.
11
11
  */
12
12
  constructor(message?: string);
13
13
  }
@@ -18,7 +18,7 @@ export declare class DataDoesNotExistError extends StoredDataError {
18
18
  /**
19
19
  * Creates an instance of DataDoesNotExistError.
20
20
  *
21
- * @param message Optional error message.
21
+ * @param message - Optional error message.
22
22
  */
23
23
  constructor(message?: string);
24
24
  }
@@ -32,8 +32,8 @@ export declare class DataIsExpiredError<T> extends StoredDataError {
32
32
  /**
33
33
  * Creates an instance of DataIsExpiredError.
34
34
  *
35
- * @param data The expired data, including metadata.
36
- * @param message Optional error message. If not provided, a default message will be used.
35
+ * @param data - The expired data, including metadata.
36
+ * @param message - Optional error message. If not provided, a default message will be used.
37
37
  */
38
38
  constructor(data: ReadStoredData<T>, message?: string);
39
39
  }
@@ -10,27 +10,27 @@ export declare class MemoryStorageInstance implements StorageObject {
10
10
  /**
11
11
  * The number of items stored.
12
12
  *
13
- * @returns the current count of stored key-value pairs
13
+ * @returns The current count of stored key-value pairs.
14
14
  */
15
15
  get length(): number;
16
16
  /**
17
17
  * Returns the key at the given index.
18
18
  *
19
- * @param index The index of the key to retrieve.
19
+ * @param index - The index of the key to retrieve.
20
20
  * @returns The key string if found, otherwise null.
21
21
  */
22
22
  key(index: number): string;
23
23
  /**
24
24
  * Checks if a key exists in the storage.
25
25
  *
26
- * @param key The key to check.
26
+ * @param key - The key to check.
27
27
  * @returns True if the key exists, false otherwise.
28
28
  */
29
29
  hasKey(key: string): boolean;
30
30
  /**
31
31
  * Retrieves an item from storage.
32
32
  *
33
- * @param key The key of the item to retrieve.
33
+ * @param key - The key of the item to retrieve.
34
34
  * @returns The item string if found, otherwise null or undefined.
35
35
  */
36
36
  getItem(key: string): Maybe<string>;
@@ -38,14 +38,14 @@ export declare class MemoryStorageInstance implements StorageObject {
38
38
  * Sets an item in storage.
39
39
  * If the item is null or undefined, the key will be removed.
40
40
  *
41
- * @param key The key of the item to set.
42
- * @param item The item string to store.
41
+ * @param key - The key of the item to set.
42
+ * @param item - The item string to store.
43
43
  */
44
44
  setItem(key: string, item: Maybe<string>): void;
45
45
  /**
46
46
  * Removes an item from storage.
47
47
  *
48
- * @param key The key of the item to remove.
48
+ * @param key - The key of the item to remove.
49
49
  */
50
50
  removeItem(key: string): void;
51
51
  /**
@@ -43,7 +43,7 @@ export declare abstract class StorageObject extends SimpleStorageObject {
43
43
  * @param index The index of the key to retrieve.
44
44
  * @returns The key string if found, otherwise null.
45
45
  */
46
- abstract key(index: number): string | null;
46
+ abstract key(index: number): Maybe<string>;
47
47
  }
48
48
  /**
49
49
  * Extended synchronous Class/Interface for storing string values with additional properties.
@@ -60,7 +60,7 @@ export declare abstract class FullStorageObject extends StorageObject {
60
60
  /**
61
61
  * Removes all items from storage.
62
62
  *
63
- * @returns An array of keys that were removed.
63
+ * @returns The keys that were removed.
64
64
  */
65
65
  abstract removeAll(): string[];
66
66
  }
@@ -71,9 +71,9 @@ export declare class StorageObjectUtility {
71
71
  /**
72
72
  * Retrieves all keys from a StorageObject, optionally filtering by a prefix.
73
73
  *
74
- * @param storageObject The StorageObject to retrieve keys from.
75
- * @param prefix Optional prefix to filter keys by.
76
- * @returns An array of StoredDataStorageKey.
74
+ * @param storageObject - The StorageObject to retrieve keys from.
75
+ * @param prefix - Optional prefix to filter keys by.
76
+ * @returns Array of StoredDataStorageKey.
77
77
  */
78
78
  static allKeysFromStorageObject(storageObject: StorageObject, prefix?: string): StoredDataStorageKey[];
79
79
  }
@@ -12,13 +12,13 @@
12
12
  *
13
13
  * Empty segments (e.g. leading underscores in `_USER_ID`) are skipped.
14
14
  *
15
+ * @param input - The SCREAMING_SNAKE_CASE input.
16
+ * @returns The camelCase form.
17
+ *
15
18
  * @dbxUtil
16
19
  * @dbxUtilCategory string
17
20
  * @dbxUtilTags string, case, camelcase, snakecase, screaming, convert, transform
18
21
  * @dbxUtilRelated camel-or-pascal-to-screaming-snake
19
- *
20
- * @param input The SCREAMING_SNAKE_CASE input.
21
- * @returns The camelCase form.
22
22
  */
23
23
  export declare function screamingSnakeToCamelCase(input: string): string;
24
24
  /**
@@ -27,12 +27,12 @@ export declare function screamingSnakeToCamelCase(input: string): string;
27
27
  * Each upper-case character (other than the first) is preceded by an
28
28
  * underscore, then the whole result is upper-cased.
29
29
  *
30
+ * @param input - The camelCase / PascalCase input.
31
+ * @returns The SCREAMING_SNAKE_CASE form.
32
+ *
30
33
  * @dbxUtil
31
34
  * @dbxUtilCategory string
32
35
  * @dbxUtilTags string, case, camelcase, pascalcase, snakecase, screaming, convert, transform
33
36
  * @dbxUtilRelated screaming-snake-to-camel-case
34
- *
35
- * @param input The camelCase / PascalCase input.
36
- * @returns The SCREAMING_SNAKE_CASE form.
37
37
  */
38
38
  export declare function camelOrPascalToScreamingSnake(input: string): string;