Precise DOM morphing
morphing typescript dom

Optimise

+6
+6
src/morphlex.ts
··· 167 167 168 168 // This is where we actually morph the nodes. The `morph` function (above) exists only to set up the `idMap`. 169 169 #morphNode(pair: NodeReferencePair<ChildNode>): void { 170 + const [node, reference] = pair 171 + 172 + if (node.nodeType === 3 && reference.nodeType === 3) { 173 + if (node.textContent === reference.textContent) return 174 + } 175 + 170 176 if (isMatchingElementPair(pair)) this.#morphMatchingElementNode(pair) 171 177 else this.#morphOtherNode(pair) 172 178 }