MCPcopy
hub / github.com/NitroRCr/AIaW / visit

Function visit

src/utils/codejar.ts:481–491  ·  view source on GitHub ↗
(editor: HTMLElement, visitor: (el: Node) => 'stop' | undefined)

Source from the content-addressed store, hash-verified

479 }
480
481 function visit(editor: HTMLElement, visitor: (el: Node) => 'stop' | undefined) {
482 const queue: Node[] = []
483 if (editor.firstChild) queue.push(editor.firstChild)
484 let el = queue.pop()
485 while (el) {
486 if (visitor(el) === 'stop') break
487 if (el.nextSibling) queue.push(el.nextSibling)
488 if (el.firstChild) queue.push(el.firstChild)
489 el = queue.pop()
490 }
491 }
492
493 function isCtrl(event: KeyboardEvent) {
494 return event.metaKey || event.ctrlKey

Callers 2

saveFunction · 0.85
restoreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected