diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-14 03:08:58 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-14 03:08:58 +0900 |
| commit | a8e51a340d18c3b4a89c8ec3349b70f0715cd2f8 (patch) | |
| tree | 99fc7a335718ad63e29d24c7766611f798cd326e /vhosts/blog/nuldoc-src/dom.ts | |
| parent | 59d83667eda9ecdab05961da81c18f058a8ac065 (diff) | |
| download | nsfisis.dev-a8e51a340d18c3b4a89c8ec3349b70f0715cd2f8.tar.gz nsfisis.dev-a8e51a340d18c3b4a89c8ec3349b70f0715cd2f8.tar.zst nsfisis.dev-a8e51a340d18c3b4a89c8ec3349b70f0715cd2f8.zip | |
refactor(blog/nuldoc): use object value directly instead of key-value pairs to construct attribute pairs
Diffstat (limited to 'vhosts/blog/nuldoc-src/dom.ts')
| -rw-r--r-- | vhosts/blog/nuldoc-src/dom.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vhosts/blog/nuldoc-src/dom.ts b/vhosts/blog/nuldoc-src/dom.ts index 0358d53b..bc10e134 100644 --- a/vhosts/blog/nuldoc-src/dom.ts +++ b/vhosts/blog/nuldoc-src/dom.ts @@ -89,13 +89,13 @@ function makeTextNode(content: string): Text { export function el( name: string, - attrs: [string, string][], + attrs: Record<string, string>, ...children: (Node | string)[] ): Element { return { kind: "element", name: name, - attributes: new Map(attrs), + attributes: new Map(Object.entries(attrs)), children: children.map((n) => typeof n === "string" ? makeTextNode(n) : n), }; } |
