Debian Codegraph @

node/@xterm/xterm/src/common/TypedArrayUtils.ts

raw
1 /**
2 * Copyright (c) 2018 The xterm.js authors. All rights reserved.
3 * @license MIT
4 */
5
6 export type TypedArray = Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
7
8 /**
9 * Concat two typed arrays `a` and `b`.
10 * Returns a new typed array.
11 */
12 export function concat<T extends TypedArray>(a: T, b: T): T {
13 const result = new (a.constructor as any)(a.length + b.length);
14 result.set(a);
15 result.set(b, a.length);
16 return result;
17 }