diff --git a/y-octo-node/src/doc.ts b/y-octo-node/src/doc.ts index 80524dd..e35a02b 100644 --- a/y-octo-node/src/doc.ts +++ b/y-octo-node/src/doc.ts @@ -10,7 +10,7 @@ export class Doc extends Y.Doc { new Set(); private lastState: Buffer | null = null; - getArray(key: string): Array { + getArray(key = ""): Array { if (this.cachedArray.has(key)) { return this.cachedArray.get(key)!; } @@ -19,7 +19,7 @@ export class Doc extends Y.Doc { return yarray; } - getMap(key: string): Map { + getMap(key = ""): Map { if (this.cachedMap.has(key)) { return this.cachedMap.get(key)!; } @@ -28,7 +28,7 @@ export class Doc extends Y.Doc { return ymap; } - getText(key: string): Text { + getText(key = ""): Text { return this.getOrCreateText(key); } diff --git a/y-octo-node/tests/yjs/doc.spec.ts b/y-octo-node/tests/yjs/doc.spec.ts index 6f3f0f6..dc8a74a 100644 --- a/y-octo-node/tests/yjs/doc.spec.ts +++ b/y-octo-node/tests/yjs/doc.spec.ts @@ -50,7 +50,7 @@ test("testClientIdDuplicateChange", (t) => { t.assert(doc2.clientId !== doc1.clientId); }); -test.skip("testGetTypeEmptyId", (t) => { +test("testGetTypeEmptyId", (t) => { const doc1 = new Y.Doc(); doc1.getText("").insert(0, "h"); doc1.getText().insert(1, "i");