+ public splice (start: number, deleteCount?: number, ...items: T[]): CircularArray<T> {
+ let itemsRemoved: T[] = []
+ 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)
+ itemsRemoved = new CircularArray<T>(
+ itemsRemoved.length + itemsOverflowing.length,
+ ...itemsRemoved,
+ ...itemsOverflowing
+ )
+ }
+ } else if (arguments.length === 2) {
+ itemsRemoved = super.splice(start, deleteCount)
+ } else {
+ itemsRemoved = super.splice(start)