Skip to content

assertcheck v0.5.15


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 ParameterDescription
TThe type of the wrapped value.

Constructors

Constructor

ts
new Checker<T>(value): Checker<T>;

Defined in: src/checker.ts:59

Parameters

ParameterType
valueT

Returns

Checker<T>

Properties

PropertyModifierTypeDefined in
valuereadonlyTsrc/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

ParameterTypeDescription
fn(v) => voidA 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")

Released under the Apache 2.0 License. Built by Vagabond Studio — senior-only for growing companies.