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

Function getStoredPositions

packages/yjs-transform/src/position.ts:79–88  ·  view source on GitHub ↗
(sharedRoot: Y.XmlText)

Source from the content-addressed store, hash-verified

77}
78
79export function getStoredPositions(sharedRoot: Y.XmlText): Record<string, Y.RelativePosition> {
80 return Object.fromEntries(
81 Object.entries(sharedRoot.getAttributes())
82 .filter(([key]) => key.startsWith(STORED_POSITION_PREFIX))
83 .map(([key, position]) => [
84 key.slice(STORED_POSITION_PREFIX.length),
85 Y.createRelativePositionFromJSON(position),
86 ]),
87 )
88}
89
90function getStoredPositionsAbsolute(sharedRoot: Y.XmlText) {
91 assertDocumentAttachment(sharedRoot)

Callers 1

storedPositionsRelativeFunction · 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…