@mantine/form
Version:
Mantine form management library
13 lines (12 loc) • 464 B
JavaScript
"use client";
import { getPath } from "./get-path.mjs";
import { setPath } from "./set-path.mjs";
//#region packages/@mantine/form/src/paths/remove-path.ts
function removePath(path, index, values) {
const currentValue = getPath(path, values);
if (!Array.isArray(currentValue)) return values;
return setPath(path, currentValue.filter((_, itemIndex) => itemIndex !== index), values);
}
//#endregion
export { removePath };
//# sourceMappingURL=remove-path.mjs.map