2.1 KiB
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: unknown
[]
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 |
unknown [] |
Returns
void
Defined in
limitedArray.ts:54
get
▸ get(): unknown
[]
Return the items within the array
Returns
unknown
[]
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 |
unknown |
Returns
void
Defined in
limitedArray.ts:20
shift
▸ shift(): unknown
Remove an item from the beginning of an array
Returns
unknown
Defined in
limitedArray.ts:64