Skip to content

Commit

Permalink
refactor: fix typos (honojs#3583)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn authored and TinsFox committed Nov 11, 2024
1 parent 904e9d2 commit 0975511
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions runtime-tests/deno/stream.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { assertEquals } from '@std/assert'
import { stream, streamSSE } from '../../src/helper/streaming/index.ts'
import { Hono } from '../../src/hono.ts'

Deno.test('Shuld call onAbort via stream', async () => {
Deno.test('Should call onAbort via stream', async () => {
const app = new Hono()
let aborted = false
app.get('/stream', (c) => {
Expand Down Expand Up @@ -34,7 +34,7 @@ Deno.test('Shuld call onAbort via stream', async () => {
await server.shutdown()
})

Deno.test('Shuld not call onAbort via stream if already closed', async () => {
Deno.test('Should not call onAbort via stream if already closed', async () => {
const app = new Hono()
let aborted = false
app.get('/stream', (c) => {
Expand All @@ -54,7 +54,7 @@ Deno.test('Shuld not call onAbort via stream if already closed', async () => {
await server.shutdown()
})

Deno.test('Shuld call onAbort via streamSSE', async () => {
Deno.test('Should call onAbort via streamSSE', async () => {
const app = new Hono()
let aborted = false
app.get('/stream', (c) => {
Expand Down Expand Up @@ -87,7 +87,7 @@ Deno.test('Shuld call onAbort via streamSSE', async () => {
await server.shutdown()
})

Deno.test('Shuld not call onAbort via streamSSE if already closed', async () => {
Deno.test('Should not call onAbort via streamSSE if already closed', async () => {
const app = new Hono()
let aborted = false
app.get('/stream', (c) => {
Expand Down
2 changes: 1 addition & 1 deletion src/helper/cookie/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('Cookie Middleware', () => {
expect(res.headers.get('Fortune-Cookie')).toBe('lots-of-money')
})

it('Get signed cookie witn invalid signature', async () => {
it('Get signed cookie with invalid signature', async () => {
const req = new Request('http://localhost/cookie-signed-get-one')
// fortune_cookie has invalid signature
const cookieString =
Expand Down
4 changes: 2 additions & 2 deletions src/helper/ssg/ssg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ export const toSSG: ToSSGInterface = async (app, fs, options) => {
result = { success: false, files: [], error: errorObj }
}
if (options?.afterGenerateHook) {
const conbinedAfterGenerateHooks = combineAfterGenerateHooks(options?.afterGenerateHook)
await conbinedAfterGenerateHooks(result)
const combinedAfterGenerateHooks = combineAfterGenerateHooks(options?.afterGenerateHook)
await combinedAfterGenerateHooks(result)
}
return result
}
4 changes: 2 additions & 2 deletions src/helper/ssg/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { findTargetHandler, isMiddleware } from '../../utils/handler'
* @returns Parent dir path
*/
export const dirname = (path: string): string => {
const splittedPath = path.split(/[\/\\]/)
return splittedPath.slice(0, -1).join('/') // Windows supports slash path
const separatedPath = path.split(/[\/\\]/)
return separatedPath.slice(0, -1).join('/') // Windows supports slash path
}

const normalizePath = (path: string): string => {
Expand Down
2 changes: 1 addition & 1 deletion src/hono-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export type HonoOptions<E extends Env> = {
*/
strict?: boolean
/**
* `router` option specifices which router to use.
* `router` option specifies which router to use.
*
* @see {@link https://hono.dev/docs/api/hono#router-option}
*
Expand Down
2 changes: 1 addition & 1 deletion src/jsx/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ describe('render to string', () => {
expect(template.toString()).toBe('<p><span>a</span><span>b</span></p>')
})

it('Empty elements are rended withtout closing tag', () => {
it('Empty elements are rended without closing tag', () => {
const template = <input />
expect(template.toString()).toBe('<input/>')
})
Expand Down
6 changes: 3 additions & 3 deletions src/middleware/ip-restriction/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ const buildMatcher = (
functionRules.push(rule)
} else {
if (IS_CIDR_NOTATION_REGEX.test(rule)) {
const splittedRule = rule.split('/')
const separatedRule = rule.split('/')

const addrStr = splittedRule[0]
const addrStr = separatedRule[0]
const type = distinctRemoteAddr(addrStr)
if (type === undefined) {
throw new TypeError(`Invalid rule: ${rule}`)
}

const isIPv4 = type === 'IPv4'
const prefix = parseInt(splittedRule[1])
const prefix = parseInt(separatedRule[1])

if (isIPv4 ? prefix === 32 : prefix === 128) {
// this rule is a static rule
Expand Down
2 changes: 1 addition & 1 deletion src/router/trie-router/node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('Get with *', () => {
})
})

describe('Get with * inclusing JS reserved words', () => {
describe('Get with * including JS reserved words', () => {
const node = new Node()
node.insert('get', '*', 'get all')
it('get /', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ipaddr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('expandIPv6', () => {
})
})
describe('distinctRemoteAddr', () => {
it('Should result be valud', () => {
it('Should result be valid', () => {
expect(distinctRemoteAddr('1::1')).toBe('IPv6')
expect(distinctRemoteAddr('::1')).toBe('IPv6')

Expand Down

0 comments on commit 0975511

Please sign in to comment.