Comparing version 0.8.5 to 0.8.6
import { IncomingMessage, ServerResponse, OutgoingMessage } from 'http'; | ||
export { IncomingMessage as NodeIncomingMessage, ServerResponse as NodeServerResponse } from 'http'; | ||
import { CookieSerializeOptions } from 'cookie-es'; | ||
import { RequestHeaders as RequestHeaders$1 } from 'src/types'; | ||
import * as ufo from 'ufo'; | ||
@@ -33,2 +34,6 @@ | ||
constructor(init?: HeadersInit); | ||
[Symbol.iterator](): IterableIterator<[string, string]>; | ||
entries(): IterableIterator<[string, string]>; | ||
keys(): IterableIterator<string>; | ||
values(): IterableIterator<string>; | ||
append(name: string, value: string): void; | ||
@@ -131,2 +136,3 @@ delete(name: string): void; | ||
static __h3_error__: boolean; | ||
toJSON(): Pick<H3Error, "statusCode" | "statusMessage" | "data" | "message">; | ||
statusCode: number; | ||
@@ -144,3 +150,6 @@ fatal: boolean; | ||
*/ | ||
declare function createError(input: string | Partial<H3Error>): H3Error; | ||
declare function createError(input: string | Partial<H3Error> & { | ||
status?: number; | ||
statusText?: string; | ||
}): H3Error; | ||
/** | ||
@@ -249,2 +258,10 @@ * Receive an error and return the corresponding response.<br> | ||
interface SendProxyOptions { | ||
headers?: RequestHeaders$1 | HeadersInit; | ||
fetchOptions?: RequestInit; | ||
fetch?: typeof fetch; | ||
sendStream?: boolean; | ||
} | ||
declare function sendProxy(event: H3Event, target: string, opts?: SendProxyOptions): Promise<void>; | ||
declare function getQuery(event: H3Event): ufo.QueryObject; | ||
@@ -295,2 +312,2 @@ /** @deprecated Use `h3.getQuery` */ | ||
export { AddRouteShortcuts, App, AppOptions, AppUse, CacheConditions, CreateRouterOptions, DynamicEventHandler, Encoding, EventHandler, EventHandlerResponse, H3Error, H3Event, H3EventContext, H3Headers, H3Response, HTTPMethod, InputLayer, InputStack, Layer, LazyEventHandler, MIMES, Matcher, NodeListener, NodeMiddleware, NodePromisifiedHandler, RequestHeaders, Router, RouterMethod, RouterUse, Stack, appendHeader, appendHeaders, appendResponseHeader, appendResponseHeaders, assertMethod, callNodeListener, createApp, createAppEventHandler, createError, createEvent, createRouter, defaultContentType, defineEventHandler, defineLazyEventHandler, defineNodeListener, defineNodeMiddleware, deleteCookie, dynamicEventHandler, eventHandler, fromNodeMiddleware, getCookie, getHeader, getHeaders, getMethod, getQuery, getRequestHeader, getRequestHeaders, getResponseHeader, getResponseHeaders, getRouterParam, getRouterParams, handleCacheHeaders, isError, isEvent, isEventHandler, isMethod, isStream, lazyEventHandler, parseCookies, promisifyNodeListener, readBody, readRawBody, send, sendError, sendRedirect, sendStream, setCookie, setHeader, setHeaders, setResponseHeader, setResponseHeaders, toEventHandler, toNodeListener, use, useBase, useBody, useCookie, useCookies, useMethod, useQuery, useRawBody, writeEarlyHints }; | ||
export { AddRouteShortcuts, App, AppOptions, AppUse, CacheConditions, CreateRouterOptions, DynamicEventHandler, Encoding, EventHandler, EventHandlerResponse, H3Error, H3Event, H3EventContext, H3Headers, H3Response, HTTPMethod, InputLayer, InputStack, Layer, LazyEventHandler, MIMES, Matcher, NodeListener, NodeMiddleware, NodePromisifiedHandler, RequestHeaders, Router, RouterMethod, RouterUse, SendProxyOptions, Stack, appendHeader, appendHeaders, appendResponseHeader, appendResponseHeaders, assertMethod, callNodeListener, createApp, createAppEventHandler, createError, createEvent, createRouter, defaultContentType, defineEventHandler, defineLazyEventHandler, defineNodeListener, defineNodeMiddleware, deleteCookie, dynamicEventHandler, eventHandler, fromNodeMiddleware, getCookie, getHeader, getHeaders, getMethod, getQuery, getRequestHeader, getRequestHeaders, getResponseHeader, getResponseHeaders, getRouterParam, getRouterParams, handleCacheHeaders, isError, isEvent, isEventHandler, isMethod, isStream, lazyEventHandler, parseCookies, promisifyNodeListener, readBody, readRawBody, send, sendError, sendProxy, sendRedirect, sendStream, setCookie, setHeader, setHeaders, setResponseHeader, setResponseHeaders, toEventHandler, toNodeListener, use, useBase, useBody, useCookie, useCookies, useMethod, useQuery, useRawBody, writeEarlyHints }; |
{ | ||
"name": "h3", | ||
"version": "0.8.5", | ||
"version": "0.8.6", | ||
"description": "Tiny JavaScript Server", | ||
@@ -32,3 +32,3 @@ "repository": "unjs/h3", | ||
"@types/express": "^4.17.14", | ||
"@types/node": "^18.11.0", | ||
"@types/node": "^18.11.7", | ||
"@types/supertest": "^2.0.12", | ||
@@ -39,3 +39,3 @@ "@vitest/coverage-c8": "^0.24.3", | ||
"connect": "^3.7.0", | ||
"eslint": "^8.25.0", | ||
"eslint": "^8.26.0", | ||
"express": "^4.18.2", | ||
@@ -45,3 +45,4 @@ "get-port": "^6.1.2", | ||
"listhen": "^0.3.4", | ||
"supertest": "^6.3.0", | ||
"node-fetch-native": "^0.1.8", | ||
"supertest": "^6.3.1", | ||
"typescript": "^4.8.4", | ||
@@ -51,3 +52,3 @@ "unbuild": "^0.9.4", | ||
}, | ||
"packageManager": "pnpm@7.13.5", | ||
"packageManager": "pnpm@7.14.0", | ||
"scripts": { | ||
@@ -54,0 +55,0 @@ "build": "unbuild", |
@@ -139,2 +139,3 @@ [![npm downloads](https://img.shields.io/npm/dm/h3.svg?style=flat-square)](https://npmjs.com/package/h3) | ||
- `createError({ statusCode, statusMessage, data? })` | ||
- `sendProxy(event, { target, headers?, fetchOptions?, fetch?, sendStream? })` | ||
@@ -141,0 +142,0 @@ 👉 You can learn more about usage in [JSDocs Documentation](https://www.jsdocs.io/package/h3#package-functions). |
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
71653
1933
153
19