We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a0e9764 + 8fec6c5 commit 97faa50Copy full SHA for 97faa50
frontend/src/hooks/useYText.ts
@@ -2,7 +2,9 @@ import { useState } from "react";
2
import * as Y from "yjs";
3
import diff from "fast-diff";
4
5
-function diffToDelta(diffResult) {
+type DiffResult = [number, string][]; // 각 요소는 [연산자, 값] 형태
6
+
7
+function diffToDelta(diffResult: DiffResult) {
8
return diffResult.map(([op, value]) =>
9
op === diff.INSERT
10
? { insert: value }
0 commit comments