MCPcopy
hub / github.com/QwikDev/qwik / domToVnode

Function domToVnode

packages/qwik/src/core/render/dom/visitor.ts:289–315  ·  view source on GitHub ↗
(node: Node | VirtualElement)

Source from the content-addressed store, hash-verified

287};
288
289export const domToVnode = (node: Node | VirtualElement): ProcessedJSXNode => {
290 if (isQwikElement(node)) {
291 const t = new ProcessedJSXNodeImpl(
292 node.localName,
293 {},
294 null,
295 CHILDREN_PLACEHOLDER,
296 0,
297 getKey(node)
298 );
299 t.$elm$ = node;
300 return t;
301 } else if (isText(node)) {
302 const t = new ProcessedJSXNodeImpl(
303 node.nodeName,
304 EMPTY_OBJ,
305 null,
306 CHILDREN_PLACEHOLDER,
307 0,
308 null
309 );
310 t.$text$ = node.data;
311 t.$elm$ = node;
312 return t;
313 }
314 assertFail('Invalid node type');
315};
316
317const isHeadChildren = (node: Node | VirtualElement): boolean => {
318 const type = node.nodeType;

Callers 3

getVdomFunction · 0.90
renderRootFunction · 0.90
getVnodeFromElFunction · 0.85

Calls 4

isQwikElementFunction · 0.90
getKeyFunction · 0.90
isTextFunction · 0.90
assertFailFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…