imports/vx/both/code/util.js
/**
     * Move an object in an array using a relative offset. Negative offset means move the object
     * towards lower indices and postive values move towards higher indices.
     *
     * @param {array} array Array of objects to mutate.
     * @param {string} id Identity field in object to be moved.
     * @param {number} offset Offset either negative or positive.
     */
Move an object in an array using a relative offset. Negative offset means move the object
towards lower indices and postive values move towards higher indices.

@param {array} array Array of objects to mutate.
@param {string} id Identity field in object to be moved.
@param {number} offset Offset either negative or positive.
Move an object in an array using a relative offset . Negative offset means move the object towards lower indices and postive values move towards higher indices . @param { array } array Array of objects to mutate . @param { string } id Identity field in object to be moved . @param { number } offset Offset either negative or positive .
move(array, id, offset) {
        const index = Util.indexOf(array, "id", id)
        const newIndex = index + offset
        if (newIndex > -1 && newIndex < array.length) {
            const removedElement = array.splice(index, 1)[0]
            array.splice(newIndex, 0, removedElement)
        }
    }
move ( array , id , offset ) { const index = Util . indexOf ( array , "id" , id ) const newIndex = index + offset if ( newIndex > - 1 && newIndex < array . length ) { const removedElement = array . splice ( index , 1 ) [ 0 ] array . splice ( newIndex , 0 , removedElement ) } }
Move an object in an array using a relative offset.
Move an object in an array using a relative offset .