const updatePaths = (items: Item[], parentPath = "", childKey = "sublimit"): Item[] => {
return items.map((item, index) => {
const currentPath = `${parentPath}/${index}`;
return {
...item,
path: currentPath,
...(item[childKey] ? { [childKey]: updatePaths(item[childKey] || [], currentPath, childKey) } : {}),
};
});
};