Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bokuweb/wu-diff-js
Compute differences between two slices using wu(the O(NP)) algorithm.
https://github.com/bokuweb/wu-diff-js
Last synced: 4 days ago
JSON representation
Compute differences between two slices using wu(the O(NP)) algorithm.
- Host: GitHub
- URL: https://github.com/bokuweb/wu-diff-js
- Owner: bokuweb
- License: mit
- Created: 2018-03-23T01:18:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-23T05:10:20.000Z (12 days ago)
- Last Synced: 2024-10-25T00:34:36.709Z (10 days ago)
- Language: TypeScript
- Homepage:
- Size: 120 KB
- Stars: 17
- Watchers: 2
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-deno - wu-diff-js - 使用wu(O(NP))算法的Diff库. (Uncategorized / Uncategorized)
- awesome-deno-cn - @bokuweb/wu-diff-js
- awesome-deno - wu-diff-js - A diff library to compute differences between two slices using wu(the O(NP)) algorithm. (Libraries)
- awesome-deno - wu-diff-js - A diff library to compute differences between two slices using wu(the O(NP)) algorithm.![GitHub stars](https://img.shields.io/github/stars/bokuweb/wu-diff-js?style=plastic) (Modules / Online Playgrounds)
- awesome-deno - wu-diff-js - A diff library to compute differences between two slices using wu(the O(NP)) algorithm. (Modules / Utils)
README
# wu-diff-js
Compute differences between two slices using wu(the O(NP)) algorithm.
[![CircleCI](https://circleci.com/gh/bokuweb/wu-diff-js.svg?style=svg)](https://circleci.com/gh/bokuweb/wu-diff-js)
## Example
```javascript
import diff from 'wu-diff-js';diff(Array.from('strength'), Array.from('string'));
/*
[
{ type: 'common', value: ['s', 's'] },
{ type: 'common', value: ['t', 't'] },
{ type: 'common', value: ['r', 'r'] },
{ type: 'removed', value: 'e' },
{ type: 'added', value: 'i' },
{ type: 'common', value: ['n', 'n'] },
{ type: 'common', value: ['g', 'g'] },
{ type: 'removed', value: 't' },
{ type: 'removed', value: 'h' },
*/
```### Usage
#### with Node.js
```
npm i wu-diff-js
```### with deno
```
import diff from 'https://denopkg.com/bokuweb/[email protected]/lib/index.ts';
```## LICENSE
The MIT License (MIT)
Copyright (c) 2018 @bokuweb
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.