Skip to content

Commit fc74b3c

Browse files
committed
chore(demo): 🤖 add ot-text demo
1 parent 8fec7b2 commit fc74b3c

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
"messagepack": "^1.1.12",
9696
"msgpack-lite": "^0.1.26",
9797
"msgpack5": "^5.3.2",
98+
"ot-text": "^1.0.2",
9899
"pako": "^2.0.4",
99100
"prettier": "^2.5.1",
100101
"pretty-quick": "^3.1.3",

src/demo/ot-text.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* tslint:disable no-console */
2+
3+
/**
4+
* Run this demo with:
5+
*
6+
* npx ts-node src/demo/ot-text.ts
7+
*/
8+
9+
const {type} = require('ot-text');
10+
11+
const op1 = [1, 'a'];
12+
const op2 = [3, 'b'];
13+
14+
// const op1 = [3, 'a'];
15+
// const op2 = [3, 'b'];
16+
17+
const op3 = type.transform(op1, op2, 'left');
18+
const op4 = type.transform(op2, op1, 'right');
19+
20+
console.log('op3', op3);
21+
console.log('op4', op4);

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4726,6 +4726,11 @@ original@^1.0.0:
47264726
dependencies:
47274727
url-parse "^1.4.3"
47284728

4729+
ot-text@^1.0.2:
4730+
version "1.0.2"
4731+
resolved "https://registry.yarnpkg.com/ot-text/-/ot-text-1.0.2.tgz#fc27c12b07a93b13c328c833bf94c9c24ac46231"
4732+
integrity sha512-1xjcAjB57tYtv722j8J+IaYe4fKZOeaQ3zDa0clUlkhboawrq+dk1cpDfe4+TBSb9NNe7Yra9+tJKsw+8q4H9A==
4733+
47294734
p-each-series@^2.1.0:
47304735
version "2.2.0"
47314736
resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-2.2.0.tgz#105ab0357ce72b202a8a8b94933672657b5e2a9a"

0 commit comments

Comments
 (0)