diff --git a/CHANGELOG.md b/CHANGELOG.md index 883d4a2..3761957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ + +# 1.2.0-rc.0 - 23 Dec 2024 +Change: +- Add support for Elysia 1.2 + # 1.1.2 - 18 Dec 2024 Bug fix: - [#40](https://github.com/elysiajs/elysia-static/pull/40) serve indexHTML diff --git a/bun.lockb b/bun.lockb index 296a17e..313e050 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 3dc20fd..35cedf1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@elysiajs/static", - "version": "1.1.2", + "version": "1.2.0", "license": "MIT", "scripts": { "dev": "bun run --hot example/index.ts", @@ -24,15 +24,15 @@ "node-cache": "^5.1.2" }, "devDependencies": { - "@types/bun": "1.1.6", + "@types/bun": "1.1.14", "@typescript-eslint/eslint-plugin": "^6.7.4", - "elysia": ">= 1.1.0-rc.2", + "elysia": ">= 1.2.0", "eslint": "9.6.0", "tsup": "^8.1.0", "typescript": "^5.5.3" }, "peerDependencies": { - "elysia": ">= 1.1.0" + "elysia": ">= 1.2.0" }, "keywords": [ "elysia", @@ -51,4 +51,4 @@ "bugs": "https://github.com/elysiajs/elysia-static/issues", "description": "Plugin for Elysia for serving static folder", "homepage": "https://github.com/elysiajs/elysia-static" -} +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 8408a1d..53ea547 100644 --- a/src/index.ts +++ b/src/index.ts @@ -277,9 +277,8 @@ export const staticPlugin = async ( headers['Etag'] = etag headers['Cache-Control'] = directive if (maxAge !== null) - headers[ - 'Cache-Control' - ] += `, max-age=${maxAge}` + headers['Cache-Control'] += + `, max-age=${maxAge}` return new Response(file, { headers @@ -297,8 +296,10 @@ export const staticPlugin = async ( `${prefix}/*`, async ({ params, headers: reqHeaders }) => { let path = enableDecodeURI - ? decodeURI(`${assets}/${decodeURI(params['*'])}`) - : `${assets}/${params['*']}` + ? // @ts-ignore + decodeURI(`${assets}/${decodeURI(params['*'])}`) + : // @ts-ignore + `${assets}/${params['*']}` // Handle varying filepath separators if (isFSSepUnsafe) { path = path.replace(URL_PATH_SEP, sep)