@onesy/diff
Version:
Diff algorithm
88 lines (61 loc) • 1.35 kB
Markdown
</br>
</br>
<p align='center'>
<a target='_blank' rel='noopener noreferrer' href='#'>
<img src='utils/images/logo.svg' alt='onesy logo' />
</a>
</p>
<h1 align='center'>onesy Diff</h1>
<p align='center'>
Own implementation of The Myers Difference Algorithm
</p>
<br />
<h3 align='center'>
<sub>MIT license </sub>
<sub>Production ready </sub>
<sub>UMD 3.1kb gzipped </sub>
<sub>100% test cov </sub>
<sub>Browser and Nodejs</sub>
</h3>
<p align='center'>
<sub>Very simple code </sub>
<sub>Modern code </sub>
<sub>Junior friendly </sub>
<sub>Typescript </sub>
<sub>Made with :yellow_heart:</sub>
</p>
<br />
## Getting started
### Add
```sh
yarn add @onesy/diff
```
### Use
```javascript
import OnesyDiff from '@onesy/diff';
// Make a new OnesyDiff instance
// with an optional initial value for options
const onesyDiff = new OnesyDiff();
// Diff
const diff = onesyDiff.diff('aaa', 'aab');
// {
// items: ['r', 2, 'a', 2, 'b']
// }
// Update
onesyDiff.update('aaa', diff);
// 'aab'
```
### Dev
Install
```sh
yarn
```
Test
```sh
yarn test
```
### Prod
Build
```sh
yarn build
```