How to use the @remirror/core-utils.isEditorSchema function in @remirror/core-utils

To help you get started, we’ve selected a few @remirror/core-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ifiokjr / remirror / packages / jest-prosemirror / src / jest-prosemirror-serializer.ts View on Github external
print: val => {
    if (isEditorState(val)) {
      return `Prosemirror doc: ${JSON.stringify(
        val.doc.toJSON(),
        null,
        2,
      )}\nProsemirror selection: ${JSON.stringify(val.selection, null, 2)}`;
    }

    if (isEditorSchema(val)) {
      const nodes = keys(val.nodes).reduce((acc, key) => {
        const { spec } = val.nodes[key];
        return { ...acc, [key]: spec };
      }, {});
      const marks = keys(val.marks).reduce((acc, key) => {
        const { spec } = val.marks[key];
        return { ...acc, [key]: spec };
      }, {});

      return `Prosemirror schema: ${JSON.stringify(
        {
          nodes,
          marks,
        },
        null,
        2,