Type Alias KeepMatch<A, Criteria>

KeepMatch<A, Criteria>: Filter<A, Criteria>

⚗️ transform 👽 alias

Keeps entries satisfying Criteria in array or tuple A.

Type Parameters

  • A extends readonly unknown[]
  • Criteria

of Filter

type R = KeepMatch<[1, 2, 3], number> // [1, 2]
type R = KeepMatch<Array<string|undefined>, string> // string[]