From 0bed8f0eb47bb1572c1f5f1339966cb94bbf4b5b Mon Sep 17 00:00:00 2001 From: Tyler Akins Date: Wed, 24 Jul 2024 14:18:29 -0500 Subject: [PATCH] Text nodes do not have .attributes --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index ce5c6ed..0f9d45c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -131,7 +131,7 @@ export class Cona extends HTMLElement { if (c?.attributes) { while (c.attributes.length > 0) c.removeAttribute(c.attributes[0].name); - for (const { name, value } of this._nodeMap(n?.attributes)) { + for (const { name, value } of this._nodeMap(n?.attributes || [])) { c.setAttribute(name, value); } }