Skip to content

assertcheck v1.0.0


assertcheck / assert / idempotent

Function: idempotent()

ts
function idempotent<T>(
   fn, 
   arg, 
   opts?): void;

Defined in: src/assert.ts:1804

Asserts that fn(fn(x)) equals fn(x) (idempotent function).

Type Parameters

Type Parameter
T

Parameters

ParameterType
fn(v) => T
argT
opts?Opts

Returns

void

Example

ts
`assert.idempotent(normalizeEmail, "Alice@Example.COM")`

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