Precise DOM morphing
morphing typescript dom

Add a prefix to exceptions

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