mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-28 14:50:58 +00:00
19 lines
424 B
JavaScript
19 lines
424 B
JavaScript
'use client';
|
|
import { getPath } from './get-path.mjs';
|
|
import { setPath } from './set-path.mjs';
|
|
|
|
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
|
|
);
|
|
}
|
|
|
|
export { removePath };
|
|
//# sourceMappingURL=remove-path.mjs.map
|