Skip to content

equal

equal() compares two wrapped primitives (or a primitive and a raw value) and returns a type guard. Useful for filtering or matching on business values.

Interactive example

Syntax

Classic signature

typescript
function equal(
	input: Primitives, 
	value: Primitives
): boolean

Curried signature

typescript
function equal(
	value: Primitives
): (input: Primitives) => boolean

Parameters

  • input : primitive to compare (classic signature only).
  • value : comparison value (wrapped primitive or compatible raw value).

Return value

A boolean (type guard on the TypeScript side) indicating whether the unwrapped values are strictly equal.

See also

Released under the MIT license.