Skip to main content
Module

x/ts_toolbelt_unofficial/mod.ts>Tuple.Assign

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

Assign a list of [[List]] into L with [[Merge]]. Merges from left to right, first items get overridden by the next ones (last-in overrides).

Examples

Example 1

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

type test0 = Assign<[1, 2, 3], [[2, 1]]> // [2, 1, 3]
type test1 = Assign<[], [[1, 2, 3, 4], [2, 4, 6]]> // [2, 4, 6, 4]
type test2 = Assign<[0, 0, 0, 0, 0], [[0, 1], [0, 2, 0, 4?]]> // [0, 2, 0, 0 | 4, 0]

Type Parameters

L extends List
Ls extends List<List>
optional
depth extends Depth = "flat"
optional
ignore extends object = BuiltIn
optional
fill extends any = never
definition: Cast<OAssign<L, Ls, depth, ignore, fill>, List>