Comparing version 1.9.0 to 1.10.0
@@ -216,3 +216,3 @@ import { QueryObject } from 'ufo'; | ||
*/ | ||
declare class H3Error<DataT = any> extends Error { | ||
declare class H3Error<DataT = unknown> extends Error { | ||
static __h3_error__: boolean; | ||
@@ -236,6 +236,6 @@ statusCode: number; | ||
*/ | ||
declare function createError<DataT = any>(input: string | (Partial<H3Error<DataT>> & { | ||
declare function createError<DataT = unknown>(input: string | (Partial<H3Error<DataT>> & { | ||
status?: number; | ||
statusText?: string; | ||
})): H3Error; | ||
})): H3Error<DataT>; | ||
/** | ||
@@ -258,3 +258,3 @@ * Receives an error and returns the corresponding response. | ||
*/ | ||
declare function isError(input: any): input is H3Error; | ||
declare function isError<DataT = unknown>(input: any): input is H3Error<DataT>; | ||
@@ -588,3 +588,3 @@ interface Layer { | ||
declare function getResponseHeader(event: H3Event, name: HTTPHeaderName): ReturnType<H3Event["res"]["getHeader"]>; | ||
declare function setResponseHeaders(event: H3Event, headers: Record<string, Parameters<OutgoingMessage["setHeader"]>[1]>): void; | ||
declare function setResponseHeaders(event: H3Event, headers: Record<HTTPHeaderName, Parameters<OutgoingMessage["setHeader"]>[1]>): void; | ||
declare const setHeaders: typeof setResponseHeaders; | ||
@@ -591,0 +591,0 @@ declare function setResponseHeader(event: H3Event, name: HTTPHeaderName, value: Parameters<OutgoingMessage["setHeader"]>[1]): void; |
{ | ||
"name": "h3", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"description": "Minimal H(TTP) framework built for high performance and portability.", | ||
@@ -30,3 +30,3 @@ "repository": "unjs/h3", | ||
"uncrypto": "^0.1.3", | ||
"unenv": "^1.7.4" | ||
"unenv": "^1.8.0" | ||
}, | ||
@@ -36,9 +36,9 @@ "devDependencies": { | ||
"@types/express": "^4.17.21", | ||
"@types/node": "^20.9.2", | ||
"@types/supertest": "^2.0.16", | ||
"@vitest/coverage-v8": "^0.34.6", | ||
"autocannon": "^7.12.0", | ||
"@types/node": "^20.10.4", | ||
"@types/supertest": "^6.0.2", | ||
"@vitest/coverage-v8": "^1.0.2", | ||
"autocannon": "^7.14.0", | ||
"changelogen": "^0.5.5", | ||
"connect": "^3.7.0", | ||
"eslint": "^8.54.0", | ||
"eslint": "^8.55.0", | ||
"eslint-config-unjs": "^0.2.1", | ||
@@ -54,13 +54,13 @@ "express": "^4.18.2", | ||
"supertest": "^6.3.3", | ||
"typescript": "^5.2.2", | ||
"typescript": "^5.3.3", | ||
"unbuild": "^2.0.0", | ||
"vitest": "^0.34.6", | ||
"vitest": "^1.0.2", | ||
"zod": "^3.22.4" | ||
}, | ||
"packageManager": "pnpm@8.10.5", | ||
"packageManager": "pnpm@8.11.0", | ||
"scripts": { | ||
"build": "unbuild", | ||
"dev": "vitest", | ||
"lint": "eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c src test playground", | ||
"lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test playground -w", | ||
"lint": "eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c src test playground examples", | ||
"lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test playground examples -w", | ||
"play": "listhen -w ./playground/app.ts", | ||
@@ -70,5 +70,4 @@ "profile": "0x -o -D .profile -P 'autocannon -c 100 -p 10 -d 40 http://localhost:$PORT' ./playground/server.cjs", | ||
"release-rc": "pnpm test && pnpm build && changelogen --release --prerelease rc --push --publish --publishTag rc", | ||
"test": "pnpm lint && vitest --run typecheck && vitest --run --coverage", | ||
"test:types": "vitest typecheck" | ||
"test": "pnpm lint && vitest --run --coverage" | ||
} | ||
} |
@@ -12,4 +12,6 @@ # H3 | ||
π [Online Playground](https://stackblitz.com/github/unjs/h3/tree/main/playground?startScript=dev) | ||
π [Online Playground](https://stackblitz.com/github/unjs/h3/tree/main/playground) | ||
π [Online Examples Playground](https://stackblitz.com/github/unjs/h3/tree/main/examples) | ||
## Features | ||
@@ -139,3 +141,3 @@ | ||
For using nested routers, see [this example](https://stackblitz.com/edit/github-2bmusk?file=app.ts&startScript=dev) | ||
For using nested routers, see [this example](./examples/nested-router.ts) | ||
@@ -319,2 +321,10 @@ ## More app usage examples | ||
- `useValidateParams(event, schema)` | ||
- [h3-compression](https://github.com/CodeDredd/h3-compression) | ||
- `useGZipCompression(event, response)` | ||
- `useDeflateCompression(event, response)` | ||
- `useBrotliCompression(event, response)` | ||
- `useCompression(event, response)` | ||
- `useGZipCompressionStream(event, response)` | ||
- `useDeflateCompressionStream(event, response)` | ||
- `useCompressionStream(event, response)` | ||
- [@intlify/h3](https://github.com/intlify/h3) | ||
@@ -321,0 +331,0 @@ - `defineI18nMiddleware(options)` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
242480
4848
355
Updatedunenv@^1.8.0