12 lines
250 B
JavaScript
12 lines
250 B
JavaScript
export function nextStep(step) {
|
|
const {path, op, value} = step;
|
|
const parts = path.split('/');
|
|
const [key] = parts.splice(1, 1);
|
|
const subpath = parts.join('/');
|
|
return [key, {
|
|
op,
|
|
path: subpath ? subpath : '/',
|
|
value,
|
|
}];
|
|
}
|