Skip to main content
Module

x/ts_toolbelt_unofficial/mod.ts>Tuple.Append

👷 TypeScript's largest type utility library, now on Deno
Latest
type alias Tuple.Append
import { type Tuple } from "https://deno.land/x/ts_toolbelt_unofficial@1.1.0/mod.ts";
const { Append } = Tuple;

Add an element A at the end of L.

Examples

Example 1

import {L} from 'ts-toolbelt.ts'

type test0 = L.Append<[1, 2, 3], 4> // [1, 2, 3, 4]
type test1 = L.Append<[], 'a'> // ['a']
type test2 = L.Append<readonly ['a', 'b'], 'c'> // ['a', 'b', 'c']
type test3 = L.Append<[1, 2], [3, 4]> // [1, 2, [3, 4]]

Type Parameters

L extends List
A extends any
definition: [...L, A]