From a8e51a340d18c3b4a89c8ec3349b70f0715cd2f8 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 14 Aug 2024 03:08:58 +0900 Subject: refactor(blog/nuldoc): use object value directly instead of key-value pairs to construct attribute pairs --- vhosts/blog/nuldoc-src/components/utils.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vhosts/blog/nuldoc-src/components/utils.ts') diff --git a/vhosts/blog/nuldoc-src/components/utils.ts b/vhosts/blog/nuldoc-src/components/utils.ts index 5d57d033..ce693100 100644 --- a/vhosts/blog/nuldoc-src/components/utils.ts +++ b/vhosts/blog/nuldoc-src/components/utils.ts @@ -9,17 +9,17 @@ export async function stylesheetLinkElement( ): Promise { const filePath = join(Deno.cwd(), config.locations.staticDir, fileName); const hash = await calculateFileHash(filePath); - return el("link", [["rel", "stylesheet"], ["href", `${fileName}?h=${hash}`]]); + return el("link", { rel: "stylesheet", href: `${fileName}?h=${hash}` }); } export async function staticScriptElement( fileName: string, - attrs: [string, string][], + attrs: Record, config: Config, ): Promise { const filePath = join(Deno.cwd(), config.locations.staticDir, fileName); const hash = await calculateFileHash(filePath); - return el("script", [["src", `${fileName}?h=${hash}`], ...attrs]); + return el("script", { src: `${fileName}?h=${hash}`, ...attrs }); } async function calculateFileHash( -- cgit v1.2.3-70-g09d2