Hyperlinkv0.8.0-beta.28

Filter

Filter.equalsStrictconsteffect/Filter.ts:295
<const A, Input = unknown>(value: A): Filter<
  Input,
  A,
  EqualsWith<Input, A, A, Exclude<Input, A>>
>

Creates a Filter that passes only values strictly equal to the specified value using JavaScript === comparison.

When to use

Use when you need a Filter that accepts only the exact primitive value or object reference using JavaScript strict equality in a Filter / Result pipeline.

Gotchas

NaN never passes, even when the expected value is NaN, and objects pass only when they are the same reference.

constructorsequals
Source effect/Filter.ts:2953 lines
export const equalsStrict =
  <const A, Input = unknown>(value: A): Filter<Input, A, EqualsWith<Input, A, A, Exclude<Input, A>>> => (u) =>
    (u as unknown) === value ? Result.succeed(value) : Result.fail(u as any)