Skip to content

Concat

Under Construction

This documentation is auto-generated, and is a work in progress. Please see the source code at https://github.com/phetsims/phet-core/blob/main/js/types/Concat.ts for the most up-to-date information.

Overview

Type Concat

Concatenating tuple types, see https://stackoverflow.com/questions/64630803/concat-tuple-types-in-typescript

For instance, Concat<[A, B], [C, D]> is equivalent to [A, B, C, D]. This can also flatten an array with Concat<...types>.

@author Jonathan Olson <jonathan.olson@colorado.edu>

import type { Concat } from 'scenerystack/phet-core';

T extends [ infer A, ...infer Rest ] ? A extends IntentionalAny[] ? [ ...A, ...( Concat<Rest> extends IntentionalAny[] ? Concat<Rest> : [] ) ] : A : T

Source Code

See the source for Concat.ts in the phet-core repository.