@rimbu/common 2.0.1 → 2.0.3

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.
package/src/err.mts CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Throws an `Err.ForcedError` error when called.
2
+ * Throws an `ErrBase.ForcedError` error when called.
3
3
  * @example
4
4
  * ```ts
5
5
  * const emptyMap = HashMap.empty<number, string>()
6
6
  * emptyMap.get(5, Err);
7
- * // throws: Err.CustomError(message: 'Err: forced to throw error')
7
+ * // throws: ErrBase.ForcedError(message: 'Err: Forced to throw error')
8
8
  * ```
9
9
  */
10
10
  export function Err(): never {
@@ -18,11 +18,14 @@ export namespace ErrBase {
18
18
  export abstract class CustomError {
19
19
  constructor(readonly message: string) {}
20
20
 
21
- get name() {
21
+ get name(): string {
22
22
  return this.constructor.name;
23
23
  }
24
24
  }
25
25
 
26
+ /**
27
+ * Error type that is thrown by `Err` and the functions returned by `ErrBase.msg`.
28
+ */
26
29
  export class ForcedError extends CustomError {}
27
30
 
28
31
  /**
@@ -32,7 +35,7 @@ export namespace ErrBase {
32
35
  * ```ts
33
36
  * const emptyMap = HashMap.empty<number, string>()
34
37
  * emptyMap.get(5, ErrBase.msg('not found'));
35
- * // throws: Err.CustomError(message: 'not found')
38
+ * // throws: ErrBase.ForcedError(message: 'not found')
36
39
  * ```
37
40
  */
38
41
  export function msg(message: string): () => never {
package/src/index.mts CHANGED
@@ -1,7 +1,13 @@
1
1
  /**
2
2
  * @packageDocumentation
3
3
  *
4
- * The `@rimbu/common` package provides many commonly used types and utilities that can also be of use to Rimbu users.<br/>
4
+ * The `@rimbu/common` package provides shared equality and comparison helpers, range and index
5
+ * utilities, lazy and async value helpers, traversal utilities, and rich type‑level helpers used
6
+ * throughout the Rimbu ecosystem.<br/>
7
+ * Use it when you need well‑tested primitives like `Eq`, `Comp`, `Range`, `OptLazy`, `AsyncOptLazy`,
8
+ * or advanced type utilities in your own code, or when building on top of other Rimbu packages.<br/>
9
+ * See the [Common docs](https://rimbu.org/docs/common/overview) and
10
+ * [API reference](https://rimbu.org/api/rimbu/common) for more information.
5
11
  */
6
12
 
7
13
  export * from './internal.mjs';