MCPcopy Create free account
hub / github.com/editablejs/editable / assertDocumentAttachment

Function assertDocumentAttachment

packages/yjs-transform/src/yjs.ts:3–9  ·  view source on GitHub ↗
(
  sharedType: T,
)

Source from the content-addressed store, hash-verified

1import * as Y from 'yjs'
2
3export function assertDocumentAttachment<T extends Y.AbstractType<any>>(
4 sharedType: T,
5): asserts sharedType is T & { doc: NonNullable<T['doc']> } {
6 if (!sharedType.doc) {
7 throw new Error("shared type isn't attached to a document")
8 }
9}

Callers 4

storePositionFunction · 0.90
removeStoredPositionFunction · 0.90
withYjsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…