import { findNodeById } from "../helpers/index.js";
const setNodeAttrsById = (id, attrs = {}) => ({ tr }) => {
  const nodesWithPos = findNodeById(tr, id);
  if (nodesWithPos.length > 0) {
    const { pos } = nodesWithPos[0];
    tr.setNodeMarkup(pos, void 0, { id, ...attrs });
    return true;
  } else {
    console.error("Failed to find node by id");
    return false;
  }
};
export {
  setNodeAttrsById
};
//# sourceMappingURL=set-node-attrs-by-id.js.map
