-// Copyright Jerome Benoit. 2021-2023. All Rights Reserved.
+// Copyright Jerome Benoit. 2021-2024. All Rights Reserved.
-const DEFAULT_CIRCULAR_ARRAY_SIZE = 1024
+export const DEFAULT_CIRCULAR_ARRAY_SIZE = 1024
/**
* Array with a maximum length and shifting items when full.
+ *
+ * @typeParam T - Type of items.
+ * @internal
*/
export class CircularArray<T> extends Array<T> {
public size: number
...items: T[]
): CircularArray<T> {
let itemsRemoved: T[] = []
- if (arguments.length >= 3 && deleteCount !== undefined) {
+ if (arguments.length >= 3 && deleteCount != null) {
itemsRemoved = super.splice(start, deleteCount, ...items)
if (this.length > this.size) {
const itemsOverflowing = super.splice(0, this.length - this.size)