Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

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

Create and manage your GitHub workflows with TypeScript and Deno.
Latest
type alias Includes
import { type Includes } from "https://deno.land/x/actionify@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: Value extends readonly [Value[0], ...infer rest] ? IsEqual<Value[0], Item> extends true ? true : Includes<rest, Item> : false