text: "use strict";
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
  
  var moveIndex = function moveIndex(shape, offset) {
    var k = shape.length - 1;
    var c = shape[0];
    var l = shape[k];
    var o = (offset % k + k) % k;
  
    if (c.x === l.x && c.y === l.y) {
      return [{ x: shape[o].x, y: shape[o].y, moveTo: true }].concat(_toConsumableArray(shape.splice(o + 1)), _toConsumableArray(shape.splice(1, o)));
    }
  
    return shape;
  };
  
  exports.default = moveIndex;