Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Mar 2, 2024
1 parent e1e6bea commit 4be2c4c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions deno/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions playground/deno/main.ts
Original file line number Diff line number Diff line change
@@ -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}`)
2 changes: 1 addition & 1 deletion scripts/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!')
Expand Down

0 comments on commit 4be2c4c

Please sign in to comment.