Skip to content

Commit 8a1e94f

Browse files
committed
🧹 chore: bump version
1 parent 9c05ee5 commit 8a1e94f

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2+
# 1.2.0-rc.0 - 23 Dec 2024
3+
Change:
4+
- Add support for Elysia 1.2
5+
16
# 1.1.2 - 18 Dec 2024
27
Bug fix:
38
- [#40](https://github.com/elysiajs/elysia-static/pull/40) serve indexHTML

bun.lockb

-1.53 KB
Binary file not shown.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elysiajs/static",
3-
"version": "1.1.2",
3+
"version": "1.2.0",
44
"license": "MIT",
55
"scripts": {
66
"dev": "bun run --hot example/index.ts",
@@ -24,15 +24,15 @@
2424
"node-cache": "^5.1.2"
2525
},
2626
"devDependencies": {
27-
"@types/bun": "1.1.6",
27+
"@types/bun": "1.1.14",
2828
"@typescript-eslint/eslint-plugin": "^6.7.4",
29-
"elysia": ">= 1.1.0-rc.2",
29+
"elysia": ">= 1.2.0",
3030
"eslint": "9.6.0",
3131
"tsup": "^8.1.0",
3232
"typescript": "^5.5.3"
3333
},
3434
"peerDependencies": {
35-
"elysia": ">= 1.1.0"
35+
"elysia": ">= 1.2.0"
3636
},
3737
"keywords": [
3838
"elysia",
@@ -51,4 +51,4 @@
5151
"bugs": "https://github.com/elysiajs/elysia-static/issues",
5252
"description": "Plugin for Elysia for serving static folder",
5353
"homepage": "https://github.com/elysiajs/elysia-static"
54-
}
54+
}

src/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,8 @@ export const staticPlugin = async <Prefix extends string = '/prefix'>(
277277
headers['Etag'] = etag
278278
headers['Cache-Control'] = directive
279279
if (maxAge !== null)
280-
headers[
281-
'Cache-Control'
282-
] += `, max-age=${maxAge}`
280+
headers['Cache-Control'] +=
281+
`, max-age=${maxAge}`
283282

284283
return new Response(file, {
285284
headers
@@ -297,8 +296,10 @@ export const staticPlugin = async <Prefix extends string = '/prefix'>(
297296
`${prefix}/*`,
298297
async ({ params, headers: reqHeaders }) => {
299298
let path = enableDecodeURI
300-
? decodeURI(`${assets}/${decodeURI(params['*'])}`)
301-
: `${assets}/${params['*']}`
299+
? // @ts-ignore
300+
decodeURI(`${assets}/${decodeURI(params['*'])}`)
301+
: // @ts-ignore
302+
`${assets}/${params['*']}`
302303
// Handle varying filepath separators
303304
if (isFSSepUnsafe) {
304305
path = path.replace(URL_PATH_SEP, sep)

0 commit comments

Comments
 (0)