Sha256: f3dedc92d06e0fdc43e76c2e1acca21759dd63d2572c9ec78a5188249965d944
Contents?: true
Size: 561 Bytes
Versions: 33
Compression:
Stored size: 561 Bytes
Contents
import type {IsEqual} from './internal'; /** Returns a boolean for whether the given array includes the given item. This can be useful if another type wants to make a decision based on whether the array includes that item. @example ``` import type {Includes} from 'type-fest'; type hasRed<array extends any[]> = Includes<array, 'red'>; ``` @category Array */ export type Includes<Value extends readonly any[], Item> = Value extends readonly [Value[0], ...infer rest] ? IsEqual<Value[0], Item> extends true ? true : Includes<rest, Item> : false;
Version data entries
33 entries across 33 versions & 1 rubygems