Skip to content

Commit d9475b8

Browse files
author
Aleksandr Yakunichev
committed
Update arrayMove util.
Update arrayMove util to return the copy of array, instead of mutating the passed one.
1 parent d3de3ba commit d9475b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utils.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
export function arrayMove (array, previousIndex, newIndex) {
1+
export function arrayMove (arr, previousIndex, newIndex) {
2+
const array = arr.slice(0);
23
if (newIndex >= array.length) {
34
var k = newIndex - array.length;
45
while ((k--) + 1) {

0 commit comments

Comments
 (0)