From 25c434a514152fdd02e5405e4de418cd62614c6a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 30 Dec 2023 09:50:30 -0400 Subject: html: allow adding an Attributes object --- src/util/html.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/util/html.js b/src/util/html.js index dd6c3b05..ecc2b065 100644 --- a/src/util/html.js +++ b/src/util/html.js @@ -673,6 +673,10 @@ export class Attributes { return attributes.map(item => this.#addMultipleAttributes(item)); } + if (attributes instanceof Attributes) { + return this.#addMultipleAttributes(attributes.attributes); + } + if (attributes instanceof Template) { const resolved = Template.resolve(attributes); isAttributesAdditionSingletValue(resolved); @@ -1379,6 +1383,7 @@ export const isAttributesAdditionPair = pair => { export const isAttributesAdditionSingletValue = oneOf( validateInstanceOf(Template), + validateInstanceOf(Attributes), validateAllPropertyValues(isAttributeValue), looseArrayOf(value => isAttributesAdditionSingletValue(value))); -- cgit 1.3.0-6-gf8a5