Skip to main content
Module

x/scaffold/src/deps/types.ts>Includes

scaffold your next project with style and 💗
Latest
type alias Includes
import { type Includes } from "https://deno.land/x/scaffold@0.3.0/src/deps/types.ts";

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.

Examples

Example 1

import type {Includes} from 'type-fest';

type hasRed<array extends any[]> = Includes<array, 'red'>;

Type Parameters

Value extends readonly any[]
Item
definition: IsEqual<Value[0], Item> extends true ? true : Value extends [Value[0], ...infer rest] ? Includes<rest, Item> : false