🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

h3

Package Overview
Dependencies
Maintainers
1
Versions
106
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

h3 - npm Package Compare versions

Comparing version

to
1.6.0

27

dist/index.d.ts

@@ -30,3 +30,3 @@ import { CookieSerializeOptions } from 'cookie-es';

readonly id: string | undefined;
readonly data: SessionDataT;
readonly data: T;
update: (update: SessionUpdate<T>) => Promise<any>;

@@ -40,3 +40,3 @@ clear: () => Promise<any>;

declare function unsealSession(_event: H3Event, config: SessionConfig, sealed: string): Promise<Partial<Session<SessionDataT>>>;
declare function clearSession(event: H3Event, config: SessionConfig): Promise<void>;
declare function clearSession(event: H3Event, config: Partial<SessionConfig>): Promise<void>;

@@ -236,3 +236,3 @@ type HTTPMethod = "GET" | "HEAD" | "PATCH" | "POST" | "PUT" | "DELETE" | "CONNECT" | "OPTIONS" | "TRACE";

* ```ts
* const body = await useBody(req)
* const body = await readBody(req)
* ```

@@ -276,3 +276,3 @@ */

* ```ts
* const authorization = useCookie(request, 'Authorization')
* const authorization = getCookie(request, 'Authorization')
* ```

@@ -302,2 +302,12 @@ */

declare function deleteCookie(event: H3Event, name: string, serializeOptions?: CookieSerializeOptions): void;
/**
* Set-Cookie header field-values are sometimes comma joined in one string. This splits them without choking on commas
* that are within a single set-cookie field-value, such as in the Expires portion.
* This is uncommon, but explicitly allowed - see https://tools.ietf.org/html/rfc2616#section-4.2
* Node.js does this for every header *except* set-cookie - see https://github.com/nodejs/node/blob/d5e363b77ebaf1caf67cd7528224b651c86815c1/lib/_http_incoming.js#L128
* Based on: https://github.com/google/j2objc/commit/16820fdbc8f76ca0c33472810ce0cb03d20efe25
* Credits to: https://github.com/tomball for original and https://github.com/chrusart for JavaScript implementation
* @source https://github.com/nfriedly/set-cookie-parser/blob/3eab8b7d5d12c8ed87832532861c1a35520cf5b3/lib/set-cookie.js#L144
*/
declare function splitCookiesString(cookiesString: string): string[];

@@ -315,3 +325,5 @@ interface ProxyOptions {

declare function getProxyRequestHeaders(event: H3Event): any;
declare function fetchWithEvent(event: H3Event, req: RequestInfo | URL, init?: RequestInit, options?: {
declare function fetchWithEvent(event: H3Event, req: RequestInfo | URL, init?: RequestInit & {
context?: H3EventContext;
}, options?: {
fetch: typeof fetch;

@@ -330,2 +342,5 @@ }): Promise<Response>;

declare const getHeader: typeof getRequestHeader;
declare function getRequestHost(event: H3Event): string;
declare function getRequestProtocol(event: H3Event): "https" | "http";
declare function getRequestURL(event: H3Event): URL;

@@ -394,2 +409,2 @@ declare function send(event: H3Event, data?: any, type?: string): Promise<void>;

export { AddRouteShortcuts, App, AppOptions, AppUse, CacheConditions, CreateRouterOptions, DynamicEventHandler, Encoding, EventHandler, EventHandlerResponse, H3CorsOptions, H3Error, H3Event, H3EventContext, H3Headers, H3Response, HTTPMethod, InputLayer, InputStack, Layer, LazyEventHandler, MIMES, Matcher, MultiPartData, NodeEventContext, NodeListener, NodeMiddleware, NodePromisifiedHandler, ProxyOptions, RequestHeaders, Router, RouterMethod, RouterUse, Session, SessionConfig, SessionData, Stack, appendCorsHeaders, appendCorsPreflightHeaders, appendHeader, appendHeaders, appendResponseHeader, appendResponseHeaders, assertMethod, callNodeListener, clearSession, createApp, createAppEventHandler, createError, createEvent, createRouter, defaultContentType, defineEventHandler, defineLazyEventHandler, defineNodeListener, defineNodeMiddleware, deleteCookie, dynamicEventHandler, eventHandler, fetchWithEvent, fromNodeMiddleware, getCookie, getHeader, getHeaders, getMethod, getProxyRequestHeaders, getQuery, getRequestHeader, getRequestHeaders, getResponseHeader, getResponseHeaders, getResponseStatus, getResponseStatusText, getRouterParam, getRouterParams, getSession, handleCacheHeaders, handleCors, isCorsOriginAllowed, isError, isEvent, isEventHandler, isMethod, isPreflightRequest, isStream, lazyEventHandler, parseCookies, promisifyNodeListener, proxyRequest, readBody, readMultipartFormData, readRawBody, sealSession, send, sendError, sendNoContent, sendProxy, sendRedirect, sendStream, setCookie, setHeader, setHeaders, setResponseHeader, setResponseHeaders, setResponseStatus, toEventHandler, toNodeListener, unsealSession, updateSession, use, useBase, useSession, writeEarlyHints };
export { AddRouteShortcuts, App, AppOptions, AppUse, CacheConditions, CreateRouterOptions, DynamicEventHandler, Encoding, EventHandler, EventHandlerResponse, H3CorsOptions, H3Error, H3Event, H3EventContext, H3Headers, H3Response, HTTPMethod, InputLayer, InputStack, Layer, LazyEventHandler, MIMES, Matcher, MultiPartData, NodeEventContext, NodeListener, NodeMiddleware, NodePromisifiedHandler, ProxyOptions, RequestHeaders, Router, RouterMethod, RouterUse, Session, SessionConfig, SessionData, Stack, appendCorsHeaders, appendCorsPreflightHeaders, appendHeader, appendHeaders, appendResponseHeader, appendResponseHeaders, assertMethod, callNodeListener, clearSession, createApp, createAppEventHandler, createError, createEvent, createRouter, defaultContentType, defineEventHandler, defineLazyEventHandler, defineNodeListener, defineNodeMiddleware, deleteCookie, dynamicEventHandler, eventHandler, fetchWithEvent, fromNodeMiddleware, getCookie, getHeader, getHeaders, getMethod, getProxyRequestHeaders, getQuery, getRequestHeader, getRequestHeaders, getRequestHost, getRequestProtocol, getRequestURL, getResponseHeader, getResponseHeaders, getResponseStatus, getResponseStatusText, getRouterParam, getRouterParams, getSession, handleCacheHeaders, handleCors, isCorsOriginAllowed, isError, isEvent, isEventHandler, isMethod, isPreflightRequest, isStream, lazyEventHandler, parseCookies, promisifyNodeListener, proxyRequest, readBody, readMultipartFormData, readRawBody, sealSession, send, sendError, sendNoContent, sendProxy, sendRedirect, sendStream, setCookie, setHeader, setHeaders, setResponseHeader, setResponseHeaders, setResponseStatus, splitCookiesString, toEventHandler, toNodeListener, unsealSession, updateSession, use, useBase, useSession, writeEarlyHints };
{
"name": "h3",
"version": "1.5.0",
"version": "1.6.0",
"description": "Tiny JavaScript Server",

@@ -28,20 +28,20 @@ "repository": "unjs/h3",

"radix3": "^1.0.0",
"ufo": "^1.1.0",
"ufo": "^1.1.1",
"uncrypto": "^0.1.2"
},
"devDependencies": {
"0x": "^5.4.1",
"0x": "^5.5.0",
"@types/express": "^4.17.17",
"@types/node": "^18.13.0",
"@types/node": "^18.15.0",
"@types/supertest": "^2.0.12",
"@vitest/coverage-c8": "^0.28.5",
"@vitest/coverage-c8": "^0.29.2",
"autocannon": "^7.10.0",
"changelogen": "^0.4.1",
"changelogen": "^0.5.1",
"connect": "^3.7.0",
"eslint": "^8.34.0",
"eslint": "^8.35.0",
"eslint-config-unjs": "^0.1.0",
"express": "^4.18.2",
"get-port": "^6.1.2",
"jiti": "^1.17.0",
"listhen": "^1.0.2",
"jiti": "^1.17.2",
"listhen": "^1.0.3",
"node-fetch-native": "^1.0.2",

@@ -51,6 +51,6 @@ "prettier": "^2.8.4",

"typescript": "^4.9.5",
"unbuild": "^1.1.1",
"vitest": "^0.28.5"
"unbuild": "^1.1.2",
"vitest": "^0.29.2"
},
"packageManager": "pnpm@7.27.0",
"packageManager": "pnpm@7.29.0",
"scripts": {

@@ -57,0 +57,0 @@ "build": "unbuild",

@@ -1,11 +0,11 @@

[![npm downloads](https://img.shields.io/npm/dm/h3.svg?style=flat-square)](https://npmjs.com/package/h3)
[![version](https://img.shields.io/npm/v/h3/latest.svg?style=flat-square)](https://npmjs.com/package/h3)
[![bundlephobia](https://img.shields.io/bundlephobia/min/h3/latest.svg?style=flat-square)](https://bundlephobia.com/result?p=h3)
[![build status](https://img.shields.io/github/actions/workflow/status/unjs/h3/ci.yml?branch=main&style=flat-square)](https://github.com/unjs/h3/actions)
[![coverage](https://img.shields.io/codecov/c/gh/unjs/h3/main?style=flat-square)](https://codecov.io/gh/unjs/h3)
[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue?style=flat-square)](https://www.jsdocs.io/package/h3)
# H3
> H3 is a minimal h(ttp) framework built for high performance and portability
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![bundle][bundle-src]][bundle-href]
[![Codecov][codecov-src]][codecov-href]
[![License][license-src]][license-href]
[![JSDocs][jsdocs-src]][jsdocs-href]
<!-- ![h3 - Tiny JavaScript Server](.github/banner.svg) -->
H3 is a minimal h(ttp) framework built for high performance and portability.

@@ -182,2 +182,5 @@ ## Features

- `appendCorsPreflightHeaders(event, options)` (see [h3-cors](https://github.com/NozomuIkuta/h3-cors) for more detail about options)
- `getRequestHost(event)`
- `getRequestProtocol(event)`
- `getRequestURL(event)`

@@ -204,1 +207,16 @@ 👉 You can learn more about usage in [JSDocs Documentation](https://www.jsdocs.io/package/h3#package-functions).

MIT
<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/h3?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/h3
[npm-downloads-src]: https://img.shields.io/npm/dm/h3?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/h3
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/h3/main?style=flat&colorA=18181B&colorB=F0DB4F
[codecov-href]: https://codecov.io/gh/unjs/h3
[bundle-src]: https://img.shields.io/bundlephobia/minzip/h3?style=flat&colorA=18181B&colorB=F0DB4F
[bundle-href]: https://bundlephobia.com/result?p=h3
[license-src]: https://img.shields.io/github/license/unjs/h3.svg?style=flat&colorA=18181B&colorB=F0DB4F
[license-href]: https://github.com/unjs/h3/blob/main/LICENSE
[jsdocs-src]: https://img.shields.io/badge/jsDocs.io-reference-18181B?style=flat&colorA=18181B&colorB=F0DB4F
[jsdocs-href]: https://www.jsdocs.io/package/h3

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