How to use the @typewriter/editor.diff.EQUAL function in @typewriter/editor

To help you get started, we’ve selected a few @typewriter/editor 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 typewriter-editor / typewriter / packages / modules / src / input.ts View on Github external
diffs.forEach(([ action, string ]) => {
        if (action === diff.EQUAL) change.retain(string.length);
        else if (action === diff.DELETE) change.delete(string.length);
        else if (action === diff.INSERT) {
          change.insert(string, editor.activeFormats);
        }
      });
      change.chop();

@typewriter/editor

The core editor for typewriter. Manages the data model and updates. Can be run headless.

MIT
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis