@punks/backend-core 0.0.42 → 0.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js
CHANGED
|
@@ -28522,6 +28522,19 @@ const processArrayDifferences = ({ elements, elementIdSelector, desiredItems, de
|
|
|
28522
28522
|
correspondingElements,
|
|
28523
28523
|
};
|
|
28524
28524
|
};
|
|
28525
|
+
const processArrayItemMove = (items, input) => {
|
|
28526
|
+
const { oldIndex, newIndex } = input;
|
|
28527
|
+
const item = items[oldIndex];
|
|
28528
|
+
const newItems = [...items];
|
|
28529
|
+
newItems.splice(oldIndex, 1);
|
|
28530
|
+
newItems.splice(newIndex, 0, item);
|
|
28531
|
+
return newItems.map((x, i) => ({
|
|
28532
|
+
item: x,
|
|
28533
|
+
newIndex: i,
|
|
28534
|
+
oldIndex: items.indexOf(x),
|
|
28535
|
+
isMoved: i !== items.indexOf(x),
|
|
28536
|
+
}));
|
|
28537
|
+
};
|
|
28525
28538
|
|
|
28526
28539
|
exports.Log = Log;
|
|
28527
28540
|
exports.addTime = addTime;
|
|
@@ -28559,6 +28572,7 @@ exports.notNull = notNull;
|
|
|
28559
28572
|
exports.notUndefined = notUndefined;
|
|
28560
28573
|
exports.pluralize = pluralize;
|
|
28561
28574
|
exports.processArrayDifferences = processArrayDifferences;
|
|
28575
|
+
exports.processArrayItemMove = processArrayItemMove;
|
|
28562
28576
|
exports.range = range;
|
|
28563
28577
|
exports.removeUndefinedProps = removeUndefinedProps;
|
|
28564
28578
|
exports.selectMany = selectMany;
|