Skip to content

Commit 6f00ea4

Browse files
committed
chore: use absolute imports
1 parent e33149b commit 6f00ea4

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

src/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { COMPRESSIBLE_CONTENT_TYPE_REGEX } from 'hono/utils/compress'
33
import {
44
CACHECONTROL_NOTRANSFORM_REGEXP,
55
CLOUDFLARE_WORKERS_NAVIGATOR,
6-
} from './constants'
6+
} from '~/constants'
77

88
export const isCloudflareWorkers =
99
globalThis.navigator?.userAgent === CLOUDFLARE_WORKERS_NAVIGATOR

src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
export { compress, compress as default } from './middleware'
2-
export * from './streams'
3-
export * from './types'
1+
export { compress, compress as default } from '~/middleware'
2+
export * from '~/streams'
3+
export * from '~/types'

src/middleware.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
import type { Context, MiddlewareHandler } from 'hono'
22

3-
import type { CompressionEncoding, CompressionFilter, CompressOptions } from './types'
3+
import type { CompressionEncoding, CompressionFilter, CompressOptions } from '~/types'
44

55
import {
66
ACCEPTED_ENCODINGS,
77
BROTLI_LEVEL,
88
THRESHOLD_SIZE,
99
ZLIB_LEVEL,
1010
ZSTD_LEVEL,
11-
} from './constants'
11+
} from '~/constants'
1212
import {
1313
isCloudflareWorkers,
1414
isDenoDeploy,
1515
shouldCompress,
1616
shouldTransform,
1717
zlib,
18-
} from './helpers'
18+
} from '~/helpers'
1919
import {
2020
BrotliCompressionStream,
2121
ZlibCompressionStream,
2222
ZstdCompressionStream,
23-
} from './streams'
23+
} from '~/streams'
2424

2525
function checkCompressEncodings(encodings: CompressionEncoding[]) {
2626
const unsupportedEncoding: string | undefined = encodings.find(

src/streams.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import zstd from '@mongodb-js/zstd'
22

3-
import type { NodeCompressionEncoding, NodeCompressionOptions } from './types'
3+
import type { NodeCompressionEncoding, NodeCompressionOptions } from '~/types'
44

5-
import { brotli, zlib } from './helpers'
5+
import { brotli, zlib } from '~/helpers'
66

77
export class ZstdCompressionStream extends TransformStream {
88
constructor(level?: number) {

src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Context } from 'hono'
22
import type { BrotliOptions, ZlibOptions } from 'node:zlib'
33

4-
import type { ACCEPTED_ENCODINGS, NODE_ENCODINGS } from './constants'
4+
import type { ACCEPTED_ENCODINGS, NODE_ENCODINGS } from '~/constants'
55

66
export type CompressionEncoding = (typeof ACCEPTED_ENCODINGS)[number]
77

tests/index.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { describe, expect, it } from 'bun:test'
22
import { type Context, Hono } from 'hono'
33

4-
import type { CompressionEncoding } from '../src/types'
4+
import type { CompressionEncoding } from '~/types'
55

6-
import { compress } from '../src'
6+
import { compress } from '~/middleware'
77

88
const TEXT = `
99
もしも願いが一つ叶うなら

0 commit comments

Comments
 (0)