Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createComment(text: string): TestComment {
const node: TestComment = {
id: nodeId++,
type: NodeTypes.COMMENT,
text,
parentNode: null
}
logNodeOp({
type: NodeOpTypes.CREATE,
nodeType: NodeTypes.COMMENT,
targetNode: node,
text
})
// avoid test nodes from being observed
markNonReactive(node)
return node
}
id: nodeId++,
type: NodeTypes.ELEMENT,
tag,
children: [],
props: {},
parentNode: null,
eventListeners: null
}
logNodeOp({
type: NodeOpTypes.CREATE,
nodeType: NodeTypes.ELEMENT,
targetNode: node,
tag
})
// avoid test nodes from being observed
markNonReactive(node)
return node
}
function createText(text: string): TestText {
const node: TestText = {
id: nodeId++,
type: NodeTypes.TEXT,
text,
parentNode: null
}
logNodeOp({
type: NodeOpTypes.CREATE,
nodeType: NodeTypes.TEXT,
targetNode: node,
text
})
// avoid test nodes from being observed
markNonReactive(node)
return node
}