refactor: fix typos (#3583)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by mattn · committed by GitHub · parent 3af317f · Browse files · 9 files·+16 added−16 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
9 files+16 added−16 removed
- tests:+8 added−8 removed
- other:+8 added−8 removed
Provenance
- Commit
e9de50d- Tree
b3761e0- Author
mattn <mattn.jp@gmail.com>- Committer
GitHub <noreply@github.com>- Parent
3af317f
9 files changed+16 added−16 removed
modified:runtime-tests/deno/stream.test.ts+4 added-4 removed
123455678923 unmodified lines3334353637373839404111 unmodified lines5354555657575859606124 unmodified lines8687888990909192939414 unmodified linesimport { 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) => { return stream(c, (stream) => {23 unmodified lines
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) => { return stream(c, async (stream) => {11 unmodified lines assertEquals(aborted, false) 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) => { return streamSSE(c, (stream) => {24 unmodified lines
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) => { return streamSSE(c, async (stream) => {14 unmodified linesmodified:src/helper/cookie/index.test.ts+1 added-1 removed
104 unmodified lines105 const res = await app.request(req)106 expect(res.headers.get('Fortune-Cookie')).toBe('lots-of-money')107 })108 109- it('Get signed cookie witn invalid signature', async () => {109+ it('Get signed cookie with invalid signature', async () => {110 const req = new Request('http://localhost/cookie-signed-get-one')111 // fortune_cookie has invalid signature112 const cookieString =113 'fortune_cookie=lots-of-money.LAa7RX43t2vCrLNcKmNG65H41OkyV02sraRPuY5RuVg=; fruit_cookie=mango.lRwgtW9ooM9%2Fd9ZZA%2FInNRG64CbQsfWGXQyFLPM9520%3D'321 unmodified linesmodified:src/helper/ssg/ssg.ts+2 added-2 removed
379 unmodified lines380 const errorObj = error instanceof Error ? error : new Error(String(error))381 result = { success: false, files: [], error: errorObj }382 }383 if (options?.afterGenerateHook) {384- const conbinedAfterGenerateHooks = combineAfterGenerateHooks(options?.afterGenerateHook)385- await conbinedAfterGenerateHooks(result)384+ const combinedAfterGenerateHooks = combineAfterGenerateHooks(options?.afterGenerateHook)385+ await combinedAfterGenerateHooks(result)386 }387 return result388 }modified:src/helper/ssg/utils.ts+2 added-2 removed
7 unmodified lines891011121312131415161754 unmodified lines7 unmodified lines * @param path File Path * @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 => { return path.replace(/(\\)/g, '/').replace(/\/$/g, '')54 unmodified linesmodified:src/jsx/index.test.tsx+1 added-1 removed
157 unmodified lines158 )159 expect(template.toString()).toBe('<p><span>a</span><span>b</span></p>')160 })161 162- it('Empty elements are rended withtout closing tag', () => {162+ it('Empty elements are rended without closing tag', () => {163 const template = <input />164 expect(template.toString()).toBe('<input/>')165 })166 899 unmodified linesmodified:src/middleware/ip-restriction/index.ts+3 added-3 removed
46 unmodified lines47 } else if (typeof rule === 'function') {48 functionRules.push(rule)49 } else {50 if (IS_CIDR_NOTATION_REGEX.test(rule)) {51- const splittedRule = rule.split('/')51+ const separatedRule = rule.split('/')52 53- const addrStr = splittedRule[0]53+ const addrStr = separatedRule[0]54 const type = distinctRemoteAddr(addrStr)55 if (type === undefined) {56 throw new TypeError(`Invalid rule: ${rule}`)57 }58 59 const isIPv4 = type === 'IPv4'60- const prefix = parseInt(splittedRule[1])60+ const prefix = parseInt(separatedRule[1])61 62 if (isIPv4 ? prefix === 32 : prefix === 128) {63 // this rule is a static rule64 rule = addrStr114 unmodified linesmodified:src/router/trie-router/node.test.ts+1 added-1 removed
26 unmodified lines27 expect(node.search('get', '/hello')[0].length).toBe(1)28 })29 })30 31-describe('Get with * inclusing JS reserved words', () => {31+describe('Get with * including JS reserved words', () => {32 const node = new Node()33 node.insert('get', '*', 'get all')34 it('get /', () => {35 expect(node.search('get', '/hello/constructor')[0].length).toBe(1)760 unmodified linesmodified:src/utils/ipaddr.test.ts+1 added-1 removed
14 unmodified lines15 expect(expandIPv6('2001:0:0:db8::1')).toBe('2001:0000:0000:0db8:0000:0000:0000:0001')16 })17 })18 describe('distinctRemoteAddr', () => {19- it('Should result be valud', () => {19+ it('Should result be valid', () => {20 expect(distinctRemoteAddr('1::1')).toBe('IPv6')21 expect(distinctRemoteAddr('::1')).toBe('IPv6')22 23 expect(distinctRemoteAddr('192.168.2.0')).toBe('IPv4')38 unmodified linesmodified:src/hono-base.ts+1 added-1 removed
55 unmodified lines56 * @default true57 */58 strict?: boolean59 /**60- * `router` option specifices which router to use.60+ * `router` option specifies which router to use.61 *62 * @see {@link https://hono.dev/docs/api/hono#router-option}63 *64 * @example459 unmodified lines