assertcheck / Checker
Class: Checker<T>
Defined in: src/checker.ts:58
Base class holding the wrapped value. Exposes tap for inline side-effects without breaking the chain.
Extended by
Type Parameters
| Type Parameter | Description |
|---|---|
T | The type of the wrapped value. |
Constructors
Constructor
ts
new Checker<T>(value): Checker<T>;Defined in: src/checker.ts:59
Parameters
| Parameter | Type |
|---|---|
value | T |
Returns
Checker<T>
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
value | readonly | T | src/checker.ts:59 |
Methods
tap()
ts
tap(fn): this;Defined in: src/checker.ts:75
Runs a side-effect function with the wrapped value and returns this to allow chaining. Useful for logging or debugging mid-chain.
Parameters
| Parameter | Type | Description |
|---|---|---|
fn | (v) => void | A function that receives the wrapped value. |
Returns
this
The current checker instance for chaining.
Example
ts
check(orders)
.tap(v => console.log("orders:", v))
.all(o => o.status === "paid")