Precise DOM morphing
morphing typescript dom

Add a prefix to exceptions

+4 -4
+2 -2
dist/morphlex.js
··· 4 template.innerHTML = reference.trim(); 5 reference = template.content.firstChild; 6 if (!reference) { 7 - throw new Error("The provided string did not contain any nodes."); 8 } 9 } 10 if (isElement(node)) { ··· 57 this.#buildMaps(pair); 58 this.#morphMatchingElementContent(pair); 59 } else { 60 - throw new Error("You can only do an inner morph with matching elements."); 61 } 62 } 63 #buildMaps([node, reference]) {
··· 4 template.innerHTML = reference.trim(); 5 reference = template.content.firstChild; 6 if (!reference) { 7 + throw new Error("[Morphlex] The string did not contain any nodes."); 8 } 9 } 10 if (isElement(node)) { ··· 57 this.#buildMaps(pair); 58 this.#morphMatchingElementContent(pair); 59 } else { 60 + throw new Error("[Morphlex] You can only do an inner morph with matching elements."); 61 } 62 } 63 #buildMaps([node, reference]) {
+2 -2
src/morphlex.ts
··· 55 template.innerHTML = reference.trim(); 56 reference = template.content.firstChild as ChildNode; 57 if (!reference) { 58 - throw new Error("The provided string did not contain any nodes."); 59 } 60 } 61 ··· 116 this.#buildMaps(pair); 117 this.#morphMatchingElementContent(pair); 118 } else { 119 - throw new Error("You can only do an inner morph with matching elements."); 120 } 121 } 122
··· 55 template.innerHTML = reference.trim(); 56 reference = template.content.firstChild as ChildNode; 57 if (!reference) { 58 + throw new Error("[Morphlex] The string did not contain any nodes."); 59 } 60 } 61 ··· 116 this.#buildMaps(pair); 117 this.#morphMatchingElementContent(pair); 118 } else { 119 + throw new Error("[Morphlex] You can only do an inner morph with matching elements."); 120 } 121 } 122