string-delim-diff

Takes two arrays of strings, differently delimited (but identical otherwise) and gives you the mapping between them.

Usage no npm install needed!

<script type="module">
  import stringDelimDiff from 'https://cdn.skypack.dev/string-delim-diff';
</script>

README

string-delim-diff

Takes two arrays of strings, differently delimited (but identical otherwise) and gives you the mapping between them.

build status

Installation

This module is installed via npm:

$ npm install string-delim-diff

Example Usage

var stringDelimDiff = require('string-delim-diff'),
    expect = require('expect.js');

var out = map(['a', 'b c', 'd e f'], ['a b c', 'd e', 'f']);
expect(out).to.eql([
  { segments: ['a', 'b c'], more: false },
  { segments: ['d e'], more: true },
  { segments: ['f'], more: false }
]);