From 4be2c4cd41e3ab775620d330bed5ebc2d74f26b9 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sat, 2 Mar 2024 19:19:49 +0900 Subject: [PATCH] fix: format --- deno/shared.ts | 1 + playground/deno/main.ts | 12 ++++++------ scripts/deno.ts | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/deno/shared.ts b/deno/shared.ts index 68449d8..9eaed34 100644 --- a/deno/shared.ts +++ b/deno/shared.ts @@ -42,6 +42,7 @@ export function toLocale(val: string | Intl.Locale): Intl.Locale { */ export function validateLangTag(lang: string): boolean { try { + // @ts-ignore NOTE: https://github.com/microsoft/TypeScript/pull/56079 Intl.getCanonicalLocales(lang) return true } catch { diff --git a/playground/deno/main.ts b/playground/deno/main.ts index e999fa9..390f663 100644 --- a/playground/deno/main.ts +++ b/playground/deno/main.ts @@ -1,12 +1,12 @@ // @ts-ignore: this is example -import { getHeaderLanguages } from "@intlify/utils"; // module is mapped by `deno.jsonc` +import { getHeaderLanguages } from '@intlify/utils' // module is mapped by `deno.jsonc` // import { getHeaderLanguages } from 'https://deno.land/x/intlify_utils/mod.ts' -const port = 8125; +const port = 8125 Deno.serve({ port, }, (req: Request) => { - const languages = getHeaderLanguages(req); - return new Response(`detect accpect-language: ${languages}`); -}); -console.log(`server listening on ${port}`); + const languages = getHeaderLanguages(req) + return new Response(`detect accpect-language: ${languages}`) +}) +console.log(`server listening on ${port}`) diff --git a/scripts/deno.ts b/scripts/deno.ts index 18f95da..63674d5 100644 --- a/scripts/deno.ts +++ b/scripts/deno.ts @@ -41,7 +41,7 @@ async function main() { // add `npm:` prefix const webCode = await fs.readFile(resolve(destPath, 'web.ts'), 'utf-8') - const replacedWebCode = webCode.replace('from \'cookie-es\'', 'from \'npm:cookie-es\'') + const replacedWebCode = webCode.replace("from 'cookie-es'", "from 'npm:cookie-es'") await fs.writeFile(resolve(destPath, 'web.ts'), replacedWebCode, 'utf8') console.log('... 🦕 done!')