/**
 * ldesign v0.3.13
 * (c) 2023 ldesign
 * @license MIT
 */

import { _ as _toConsumableArray } from '../../../_chunks/dep-bf1e33c8.mjs';
import '../../../_chunks/dep-b8d7992c.mjs';

function swapDragArrayElement(data, currentIndex, targetIndex) {
  var newData = _toConsumableArray(data);
  if (targetIndex - currentIndex > 0) {
    newData.splice(targetIndex + 1, 0, newData[currentIndex]);
    newData.splice(currentIndex, 1);
  } else {
    newData.splice(targetIndex, 0, newData[currentIndex]);
    newData.splice(currentIndex + 1, 1);
  }
  return newData;
}

export { swapDragArrayElement as default };
//# sourceMappingURL=swapDragArrayElement.mjs.map
