mirror of
https://github.com/asphyxia-core/plugins.git
synced 2026-03-22 18:04:43 -05:00
4 lines
246 B
TypeScript
4 lines
246 B
TypeScript
export type FixedSizeArray<T, TSize extends number> = [T, ...T[]] & { readonly length: TSize }
|
|
export function fillArray<T, TSize extends number>(size: TSize, fillValue: T): FixedSizeArray<T, TSize> {
|
|
return <any>Array(size).fill(fillValue)
|
|
} |