Skip to content

Commit

Permalink
refac: apply patches
Browse files Browse the repository at this point in the history
  • Loading branch information
lord007tn committed Feb 3, 2025
1 parent 2127d80 commit 007ea3d
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"./utils/headers": "./src/utils/headers.ts",
"./utils/html": "./src/utils/html.ts",
"./utils/http-status": "./src/utils/http-status.ts",
"./utils/parse-accept": "./src/utils/parse-accept.ts",
"./utils/accept": "./src/utils/accept.ts",
"./utils/jwt": "./src/utils/jwt/index.ts",
"./utils/jwt/jwa": "./src/utils/jwt/jwa.ts",
"./utils/jwt/jws": "./src/utils/jwt/jws.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/helper/accepts/accepts.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Hono } from '../..'
import { parseAccept } from '../../utils/parse-accept'
import { parseAccept } from '../../utils/accept'
import type { Accept, acceptsConfig, acceptsOptions } from './accepts'
import { accepts, defaultMatch } from './accepts'

Expand Down
2 changes: 1 addition & 1 deletion src/helper/accepts/accepts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Context } from '../../context'
import type { AcceptHeader } from '../../utils/headers'
import { parseAccept } from '../../utils/parse-accept'
import { parseAccept } from '../../utils/accept'

Check failure on line 3 in src/helper/accepts/accepts.ts

View workflow job for this annotation

GitHub Actions / Main

`../../utils/accept` import should occur before type import of `../../utils/headers`

export interface Accept {
type: string
Expand Down
5 changes: 2 additions & 3 deletions src/middleware/language/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { LanguageVariables, DetectorType, CacheType } from './language'
export type { LanguageVariables, DetectorType, CacheType }
import type { LanguageVariables, DetectorOptions, DetectorType, CacheType } from './language'
export type { LanguageVariables, DetectorOptions, DetectorType, CacheType }
export {
languageDetector,
DetectorOptions,
detectFromCookie,
detectFromHeader,
detectFromPath,
Expand Down
2 changes: 1 addition & 1 deletion src/middleware/language/language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import type { Context } from '../../context'
import { setCookie, getCookie } from '../../helper/cookie'
import type { MiddlewareHandler } from '../../types'
import { parseAccept } from '../../utils/parse-accept'
import { parseAccept } from '../../utils/accept'

export type DetectorType = 'path' | 'querystring' | 'cookie' | 'header'
export type CacheType = 'cookie'
Expand Down
4 changes: 3 additions & 1 deletion src/utils/parse-accept.test.ts → src/utils/accept.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseAccept } from './parse-accept'
import { parseAccept } from './accept'

describe('parseAccept Comprehensive Tests', () => {
describe('Basic Functionality', () => {
Expand All @@ -12,7 +12,9 @@ describe('parseAccept Comprehensive Tests', () => {

test('handles missing header', () => {
expect(parseAccept('')).toEqual([])
// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect(parseAccept(undefined as any)).toEqual([])
// eslint-disable-next-line @typescript-eslint/no-explicit-any
expect(parseAccept(null as any)).toEqual([])
})
})
Expand Down
File renamed without changes.

0 comments on commit 007ea3d

Please sign in to comment.