( sharedType: T, )
| 1 | import * as Y from 'yjs' |
| 2 | |
| 3 | export 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 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…