« get me outta code hell

html: Attributes.with - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2024-04-03 11:22:51 -0300
committer(quasar) nebula <qznebula@protonmail.com>2024-04-03 16:55:11 -0300
commit9728073d89e6e734c193a2ce1e209d76cf17cc8c (patch)
tree8280681abc622d1405ecd5d71788693c2559fa67 /src
parent37322b13034712908abc1391dc7984b0b5095f14 (diff)
html: Attributes.with
Diffstat (limited to 'src')
-rw-r--r--src/util/html.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/html.js b/src/util/html.js
index b8dea51..7e6a668 100644
--- a/src/util/html.js
+++ b/src/util/html.js
@@ -994,6 +994,12 @@ export class Attributes {
     }
   }
 
+  with(...args) {
+    const clone = this.clone();
+    clone.add(...args);
+    return clone;
+  }
+
   #addMultipleAttributes(attributes) {
     const flatInputAttributes =
       [attributes].flat(Infinity).filter(Boolean);