Package: effect
Module: Filter
Creates a filter that only passes instances of the given constructor.
When to use
Use to narrow unknown input to values created by a specific JavaScript
constructor while keeping the result in the Filter / Result pipeline.
Details
The filter succeeds when the input satisfies instanceof constructor.
Otherwise it fails with the original input.
Gotchas
This uses JavaScript instanceof semantics, including prototype-chain and
realm behavior.
See
fromPredicate for custom predicate-based narrowingSignature
declare const instanceOf: <K extends new (...args: any) => any>(constructor: K) => <Input>(u: Input) => Result.Result<InstanceType<K>, Exclude<Input, InstanceType<K>>>
Since v4.0.0