Skip to content

chore: spelling and linting #56

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ You can do `import { ... } from '@intlify/utils'` the above utilities
- `tryPathLocale`
- `tryQueryLocale`

The about utilies functions accpet Web APIs such as [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) that is supported by JS environments (such as Deno, Bun, and Browser)
The about utilities functions accept Web APIs such as [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) that is supported by JS environments (such as Deno, Bun, and Browser)

#### Specialized environments

If you will use Node.js and H3, You can do `import { ... } from '@intlify/utils/{ENV}'` the above utilities.

The namespace `{ENV}` is one of the following:

- `node`: accpet `IncomingMessage` and `Outgoing` by Node.js [http](https://nodejs.org/api/http.html) module
- `node`: accept `IncomingMessage` and `Outgoing` by Node.js [http](https://nodejs.org/api/http.html) module
- `h3`: accept `H3Event` by HTTP framework [h3](https://github.com/unjs/h3)
- `hono`: accept `Context` by edge-side web framework [hono](https://github.com/honojs/hono)

Expand Down
4 changes: 2 additions & 2 deletions deno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,15 @@ You can do `import { ... } from '@intlify/utils'` the above utilities
- `tryPathLocale`
- `tryQueryLocale`

The about utilies functions accpet Web APIs such as [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) that is supported by JS environments (such as Deno, Bun, and Browser)
The about utilities functions accept Web APIs such as [Request](https://developer.mozilla.org/en-US/docs/Web/API/Request) and [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) that is supported by JS environments (such as Deno, Bun, and Browser)

#### Specialized environments

If you will use Node.js and H3, You can do `import { ... } from '@intlify/utils/{ENV}'` the above utilities.

The namespace `{ENV}` is one of the following:

- `node`: accpet `IncomingMessage` and `Outgoing` by Node.js [http](https://nodejs.org/api/http.html) module
- `node`: accept `IncomingMessage` and `Outgoing` by Node.js [http](https://nodejs.org/api/http.html) module
- `h3`: accept `H3Event` by HTTP framework [h3](https://github.com/unjs/h3)
- `hono`: accept `Context` by edge-side web framework [hono](https://github.com/honojs/hono)

Expand Down
2 changes: 1 addition & 1 deletion deno/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export type ParseScriptSubtag<
> = Result

/**
* paser unicode script subtag (EBNF: = alpha{4};)
* parser unicode script subtag (EBNF: = alpha{4};)
* https://unicode.org/reports/tr35/#unicode_script_subtag
*/
// TODO: Check if the script subtag is in CLDR
Expand Down
2 changes: 1 addition & 1 deletion deno/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export let pathLanguageParser: PathLanguageParser = /* #__PURE__*/ createPathInd
/**
* register the path language parser
*
* @description register a parser to be used in the `getPathLanugage` utility function
* @description register a parser to be used in the `getPathLanguage` utility function
*
* @param {PathLanguageParser} parser the path language parser
*/
Expand Down
2 changes: 1 addition & 1 deletion deno/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function getHeaderLanguages(
/**
* get language from header
*
* @description parse header string, default `accept-language`. if you use `accept-language`, this function retuns the **first language tag** of `accept-language` header.
* @description parse header string, default `accept-language`. if you use `accept-language`, this function returns the **first language tag** of `accept-language` header.
*
* @example
* example for Web API request on Deno:
Expand Down
2 changes: 1 addition & 1 deletion scripts/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function main() {
throw new Error(`not found ${destPath}`)
}

console.log('copy some source files to denoland hosting directries 🦕 ...')
console.log('copy some source files to denoland hosting directories 🦕 ...')

// copy docs
for (const p of ['README.md', 'LICENSE']) {
Expand Down
2 changes: 1 addition & 1 deletion src/h3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function getHeaderLanguages(event: H3Event, {
/**
* get language from header
*
* @description parse header string, default `accept-language`. if you use `accept-language`, this function retuns the **first language tag** of `accept-language` header.
* @description parse header string, default `accept-language`. if you use `accept-language`, this function returns the **first language tag** of `accept-language` header.
*
* @example
* example for h3:
Expand Down
2 changes: 1 addition & 1 deletion src/hono.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function getHeaderLanguages(context: Context, {
/**
* get language from header
*
* @description parse header string, default `accept-language`. if you use `accept-language`, this function retuns the **first language tag** of `accept-language` header.
* @description parse header string, default `accept-language`. if you use `accept-language`, this function returns the **first language tag** of `accept-language` header.
*
* @example
* example for Hone:
Expand Down
4 changes: 2 additions & 2 deletions src/locale.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ test('ParseVariantsSubtag', () => {
>()
})

test('ParseUnicodeLangugageId', () => {
test('ParseUnicodeLanguageId', () => {
/**
* Success cases
*/
Expand All @@ -312,7 +312,7 @@ test('ParseUnicodeLangugageId', () => {
]
>()

/** Erros */
/** Errors */
expectTypeOf<ParseUnicodeLanguageId<'a-ana-p-jauer-jauer'>>().toMatchTypeOf<
[
{ lang: never; script: never; region: never; variants: [] },
Expand Down
2 changes: 1 addition & 1 deletion src/locale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export type ParseScriptSubtag<
> = Result

/**
* paser unicode script subtag (EBNF: = alpha{4};)
* parse unicode script subtag (EBNF: = alpha{4};)
* https://unicode.org/reports/tr35/#unicode_script_subtag
*/
// TODO: Check if the script subtag is in CLDR
Expand Down
4 changes: 2 additions & 2 deletions src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function getHeaderLanguages(
/**
* get language from header
*
* @description parse header string, default `accept-language`. if you use `accept-language`, this function retuns the **first language tag** of `accept-language` header.
* @description parse header string, default `accept-language`. if you use `accept-language`, this function returns the **first language tag** of `accept-language` header.
*
* @example
* example for Node.js request:
Expand Down Expand Up @@ -577,7 +577,7 @@ let navigatorLanguage = ''
* @description
* You can get the language tag from system environment variables.
*
* @returns {string} {@link https://datatracker.ietf.org/doc/html/rfc4646#section-2.1 | BCP 47 language tag}, if you can't get the language tag, return a enmpty string.
* @returns {string} {@link https://datatracker.ietf.org/doc/html/rfc4646#section-2.1 | BCP 47 language tag}, if you can't get the language tag, return a empty string.
*/
function getNavigatorLanguage(): string {
return navigatorLanguage ||
Expand Down
2 changes: 1 addition & 1 deletion src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export let pathLanguageParser: PathLanguageParser = /* #__PURE__*/ createPathInd
/**
* register the path language parser
*
* @description register a parser to be used in the `getPathLanugage` utility function
* @description register a parser to be used in the `getPathLanguage` utility function
*
* @param {PathLanguageParser} parser the path language parser
*/
Expand Down
2 changes: 1 addition & 1 deletion src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function getHeaderLanguages(
/**
* get language from header
*
* @description parse header string, default `accept-language`. if you use `accept-language`, this function retuns the **first language tag** of `accept-language` header.
* @description parse header string, default `accept-language`. if you use `accept-language`, this function returns the **first language tag** of `accept-language` header.
*
* @example
* example for Web API request on Deno:
Expand Down
Loading