removeOne(index) {
        let idx = index;
        // expect a number or return undefined
        if (idx !== (idx | 0)) {
            return void 0;
        }
        if (this.head === this.tail) {
            return void 0;
        }
        const size = this.size();
        const len = this.list.length;
        if (idx >= size || idx < -size) {
            return void 0;
        }
        if (idx < 0) {
            idx += size;
        }
        idx = (this.head + idx) & this.capacityMask;
        const item = this.list[idx];
        let k;
        if (index < size / 2) {
            for (k = index; k > 0; k--) {
                this.list[idx] = this.list[(idx = (idx - 1 + len) & this.capacityMask)];
            }
            this.list[idx] = void 0;
            this.head = (this.head + 1 + len) & this.capacityMask;
        }
        else {
            for (k = size - 1 - index; k > 0; k--) {
                this.list[idx] = this.list[(idx = (idx + 1 + len) & this.capacityMask)];
            }
            this.list[idx] = void 0;
            this.tail = (this.tail - 1 + len) & this.capacityMask;
        }
        return item;
    }
/**
     * Remove and return the item at the specified index from the list.
     * Returns undefined if the list is empty.
     * @param index
     * @returns {*}
     */
Remove and return the item at the specified index from the list.
Returns undefined if the list is empty.
@param index
@returns {*}
Remove and return the item at the specified index from the list . Returns undefined if the list is empty . @param index @returns { * }
removeOne(index) {
        let idx = index;
        if (idx !== (idx | 0)) {
            return void 0;
        }
        if (this.head === this.tail) {
            return void 0;
        }
        const size = this.size();
        const len = this.list.length;
        if (idx >= size || idx < -size) {
            return void 0;
        }
        if (idx < 0) {
            idx += size;
        }
        idx = (this.head + idx) & this.capacityMask;
        const item = this.list[idx];
        let k;
        if (index < size / 2) {
            for (k = index; k > 0; k--) {
                this.list[idx] = this.list[(idx = (idx - 1 + len) & this.capacityMask)];
            }
            this.list[idx] = void 0;
            this.head = (this.head + 1 + len) & this.capacityMask;
        }
        else {
            for (k = size - 1 - index; k > 0; k--) {
                this.list[idx] = this.list[(idx = (idx + 1 + len) & this.capacityMask)];
            }
            this.list[idx] = void 0;
            this.tail = (this.tail - 1 + len) & this.capacityMask;
        }
        return item;
    }
removeOne ( index ) { let idx = index ; if ( idx !== ( idx | 0 ) ) { return void 0 ; } if ( this . head === this . tail ) { return void 0 ; } const size = this . size ( ) ; const len = this . list . length ; if ( idx >= size || idx < - size ) { return void 0 ; } if ( idx < 0 ) { idx += size ; } idx = ( this . head + idx ) & this . capacityMask ; const item = this . list [ idx ] ; let k ; if ( index < size / 2 ) { for ( k = index ; k > 0 ; k -- ) { this . list [ idx ] = this . list [ ( idx = ( idx - 1 + len ) & this . capacityMask ) ] ; } this . list [ idx ] = void 0 ; this . head = ( this . head + 1 + len ) & this . capacityMask ; } else { for ( k = size - 1 - index ; k > 0 ; k -- ) { this . list [ idx ] = this . list [ ( idx = ( idx + 1 + len ) & this . capacityMask ) ] ; } this . list [ idx ] = void 0 ; this . tail = ( this . tail - 1 + len ) & this . capacityMask ; } return item ; }
Remove and return the item at the specified index from the list.
Remove and return the item at the specified index from the list .
// expect a number or return undefined