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

Function cloneDeep

packages/yjs-transform/src/clone.ts:15–28  ·  view source on GitHub ↗
(yText: Y.XmlText)

Source from the content-addressed store, hash-verified

13}
14
15export function cloneDeep(yText: Y.XmlText): Y.XmlText {
16 const clone = new Y.XmlText()
17
18 const attributes = yText.getAttributes()
19 Object.entries(attributes).forEach(([key, value]) => {
20 clone.setAttribute(key, value)
21 })
22
23 clone.applyDelta(cloneInsertDeltaDeep(yTextToInsertDelta(yText)), {
24 sanitize: false,
25 })
26
27 return clone
28}

Callers 1

cloneInsertDeltaDeepFunction · 0.85

Calls 2

yTextToInsertDeltaFunction · 0.90
cloneInsertDeltaDeepFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…