utils/docs/classes/limitedArray.md
2023-04-06 00:11:07 +01:00

2.1 KiB

@rakh/utils / Exports / limitedArray

Class: limitedArray

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new limitedArray(size?)

Used to construct the LimitedArray Defaults to 100 when no size is passed in

Parameters

Name Type Default value
size number 100

Defined in

limitedArray.ts:10

Properties

_array

_array: any[]

Defined in

limitedArray.ts:2


_limit

_limit: number

Defined in

limitedArray.ts:3

Methods

add

add(items): void

Bulk add an array to the array

Parameters

Name Type
items any[]

Returns

void

Defined in

limitedArray.ts:54


get

get(): any[]

Return the items within the array

Returns

any[]

Defined in

limitedArray.ts:29


length

length(): number

Returns the length of the array

Returns

number

Defined in

limitedArray.ts:46


limit

limit(size): void

Limits the size of the array

Parameters

Name Type
size number

Returns

void

Defined in

limitedArray.ts:37


push

push(item): void

Add items to the end of an array

Parameters

Name Type
item any

Returns

void

Defined in

limitedArray.ts:20


shift

shift(): any

Remove an item from the beginning of an array

Returns

any

Defined in

limitedArray.ts:64