import { Editor } from 'slate';

const isElementActive = (editor, format) => {
  const [match] = Editor.nodes(editor, {
    match: (n) => n.type === format,
  });

  return !!match;
};

export default isElementActive;
