Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 668ec71966 | |||
| 4ed7ad210e |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartdiff",
|
"name": "@pushrocks/smartdiff",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@pushrocks/smartdiff",
|
"name": "@pushrocks/smartdiff",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fast-diff": "^1.2.0"
|
"fast-diff": "^1.2.0"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartdiff",
|
"name": "@pushrocks/smartdiff",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a diffing lib for text",
|
"description": "a diffing lib for text",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
|||||||
@@ -2,7 +2,13 @@ import { expect, tap } from '@pushrocks/tapbundle';
|
|||||||
import * as smartdiff from '../ts/index';
|
import * as smartdiff from '../ts/index';
|
||||||
|
|
||||||
tap.test('first test', async () => {
|
tap.test('first test', async () => {
|
||||||
|
const text1 = 'hi there';
|
||||||
|
const text2 = 'hi Polly, there is a Sandwich.';
|
||||||
|
const patch = smartdiff.createDiff(text1, text2);
|
||||||
|
console.log(patch);
|
||||||
|
const result = smartdiff.applyPatch(text1, patch);
|
||||||
|
console.log(result);
|
||||||
|
expect(result).to.equal(text2);
|
||||||
});
|
});
|
||||||
|
|
||||||
tap.start();
|
tap.start();
|
||||||
|
|||||||
Reference in New Issue
Block a user