($(element) as any).keydown(e => {
const {
target: {
selectionStart,
selectionEnd
},
keyCode: direction
} = e;
const htmlNode = $(this);
const inputValue = htmlNode.val();
const splittedTime = splitTime(inputValue);
const selectedValue = inputValue.substring(selectionStart, selectionEnd);
if (!selectedValue) { return; }
const Point = (x, y) => ({x, y});
const points = [Point(0, 2), Point(3, 5), Point(6, 10)];
const targetPoint = Point(selectionStart, selectionEnd);
const LEFT = 37;
const UP = 38;
const RIGHT = 39;
const DOWN = 40;
if ((direction === LEFT) || (direction === RIGHT)) {
e.preventDefault();
const index = points.findIndex(p => ((p.x === targetPoint.x) && (p.y === targetPoint.y)));
if (index === -1) { return; }
index += ((direction === LEFT) ? points.length : 1);
points.push(targetPoint);
const point = points[index % points.length];
this.setSelectionRange(point.x, point.y);
}
if ((direction === DOWN) || (direction === UP)) {
e.preventDefault();
const Actions = Enums.ValueActions;
const action = ((direction === DOWN) ? Actions.decrement : Actions. increment);
changeAppendix(splittedTime, selectedValue, htmlNode);
adjustTime(splittedTime, htmlNode, action, selectionStart, selectedValue);
this.setSelectionRange(selectionStart, selectionEnd);
}
});

while 1 == 1:while True:directory_copy = 'C:\\Users\\MinuteX\\Downloads\\This is a server of MC\\fantasy_city' #Вписать директория откуда копировать папку ||| ВАЖНО!!! С ДВОЙНЫМ СЛЕШОМ
directory = 'C:\\Users\\MinuteX\\Downloads\\Safe' #Впмсать директорию куда будут копироватся файлы, ||| ВАЖНО!!! ВСЕ СЛЕШЫ ДОЛЖНЫ БЫТЬ ДВОЙНЫМИv_DIR = directory + '\\' + new_name + "_" + dtdestination_file = os.path.join(
DESTINATION_DIR,
f'backup_{i}_{datetime.today().strftime("%Y-%m-%d-%H.%M.%S")}',
)directory_copy = ...
directory = ...
const obj = arr.find(n => n.id === newObj.id);
if (obj) {
obj.counter++;
} else {
arr.push({ ...newObj, counter: 1 });
}
И так как я особо не знаком с UI UX
идет смещение индексов, но как это обойти, уже не знаю
for (let i = arr.length; i--;) {
invItems.splice(arr[i], 1);
}for (const n of [...arr].reverse()) {
invItems.splice(n, 1);
}for (const [ i, n ] of arr.entries()) {
invItems.splice(n - i, 1);
}invItems.splice(
0,
invItems.length,
...invItems.filter((n, i) => !arr.includes(i))
);invItems.length -=
invItems.reduce((acc, n, i, a) => (
a[i - acc] = n,
acc + (i === arr[acc])
), 0);