Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cudr authored May 4, 2020
1 parent 50498d4 commit 343a924
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ This package is similar to jsdiff, but generates CRDT-friendly operations. Usefu
### Install

```bash
yarn install scto
yarn add scto
```

### Example

Text compare:
```js
```ts
import { stringDiffToOps, applyOps } from 'scto'

const origin = 'Yet so far hath discretion fought'
Expand All @@ -40,7 +40,7 @@ console.log(applyed === modifyed) // true
```

Array compare:
```js
```ts
import { collateDiffToOps, applyOps } from 'scto'

const origin = ['foo', 'bar', 'baz']
Expand All @@ -64,7 +64,7 @@ const applyed = applyOps(origin, operations)
### Possible operations:

Replace:
```
```ts
export interface Replace {
type: "replace";
offset: number;
Expand All @@ -74,7 +74,7 @@ export interface Replace {
```

Drop:
```
```ts
export interface Drop {
type: "drop";
offset: number;
Expand All @@ -83,7 +83,7 @@ export interface Drop {
```

Insert:
```
```ts
export interface Insert {
type: "insert";
offset: number;
Expand Down

0 comments on commit 343a924

Please sign in to comment.