Skip to content

arrayDeque<A>(options?): Deque<A>

Defined in: packages/deque/src/array-deque.ts:52

Create a Deque over a plain array ring buffer, for elements of any type except undefined. The type parameter excludes undefined, so arrayDeque<number | undefined>() fails to compile; store null, or a sentinel of your own, for a missing value.

A extends { } | null

DequeOptions<A> = {}

Deque<A>

With code INVALID_CAPACITY when options.capacity is not Infinity or a positive safe integer no larger than DEQUE_MAX_CAPACITY (Infinity is accepted), INVALID_VALUE when options.items holds undefined, or MAX_CAPACITY_EXCEEDED when options.items holds more elements than the layout can store.