Editor Node

1.0.1Last update Dec 8, 2024
by@krishn404

This codemod transforms Editor.node usage into Editor.nodes format. It also handles cases with both destructuring and non-destructuring .The new API returns an iterator of nodes instead of a single node, requiring changes to existing code patterns.

Before (v0.88) - Editor.node usage

const [node, path] = Editor.node(editor, at);

After (v0.104) - Editor.nodes usage

const [nodeEntry] = Editor.nodes(editor, {
at,
match: n => true,
});
const [node, path] = nodeEntry;

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now