Files
emaui/node_modules/@mantine/form/esm/paths/replace-path.mjs
2026-05-29 15:23:46 +03:00

20 lines
486 B
JavaScript

'use client';
import { getPath } from './get-path.mjs';
import { setPath } from './set-path.mjs';
function replacePath(path, item, index, values) {
const currentValue = getPath(path, values);
if (!Array.isArray(currentValue)) {
return values;
}
if (currentValue.length <= index) {
return values;
}
const cloned = [...currentValue];
cloned[index] = item;
return setPath(path, cloned, values);
}
export { replacePath };
//# sourceMappingURL=replace-path.mjs.map