Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

itty-router

Package Overview
Dependencies
Maintainers
2
Versions
265
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

itty-router - npm Package Compare versions

Comparing version 5.0.3 to 5.0.4

2

IttyRouter.d.ts
import { IRequest, IttyRouterOptions, IttyRouterType } from './types';
export declare const IttyRouter: <RequestType extends IRequest = IRequest, Args extends any[] = any[], ResponseType = any>({ base, routes, ...other }?: IttyRouterOptions) => IttyRouterType<RequestType, Args, ResponseType>;
export declare const IttyRouter: <RequestType extends IRequest = IRequest, Args extends any[] = any[], ResponseType = any, GlobalRequestType = RequestType>({ base, routes, ...other }?: IttyRouterOptions) => IttyRouterType<RequestType, Args, ResponseType, GlobalRequestType>;
{
"name": "itty-router",
"version": "5.0.3",
"version": "5.0.4",
"description": "A tiny, zero-dependency router, designed to make beautiful APIs in any environment.",

@@ -5,0 +5,0 @@ "main": "./index.js",

@@ -7,14 +7,14 @@ import { GenericTraps } from './GenericTraps';

import { CustomRoutes } from './CustomRoutes';
export type IttyRouterType<R = IRequest, A extends any[] = any[], ResponseType = any> = {
export type IttyRouterType<R = IRequest, A extends any[] = any[], ResponseType = any, GlobalRequestType = R> = {
__proto__: IttyRouterType<R>;
routes: RouteEntry[];
fetch: <Args extends any[] = A>(request: RequestLike, ...extra: Args) => Promise<ResponseType>;
all: Route<R, A>;
delete: Route<R, A>;
get: Route<R, A>;
head: Route<R, A>;
options: Route<R, A>;
patch: Route<R, A>;
post: Route<R, A>;
put: Route<R, A>;
} & CustomRoutes<Route<R, A>> & GenericTraps;
all: Route<GlobalRequestType, A>;
delete: Route<GlobalRequestType, A>;
get: Route<GlobalRequestType, A>;
head: Route<GlobalRequestType, A>;
options: Route<GlobalRequestType, A>;
patch: Route<GlobalRequestType, A>;
post: Route<GlobalRequestType, A>;
put: Route<GlobalRequestType, A>;
} & CustomRoutes<Route<GlobalRequestType, A>> & GenericTraps;
import { IRequest } from './IRequest';
import { IttyRouterType } from './IttyRouterType';
import { RequestHandler } from './RequestHandler';
export type Route<R = IRequest, A extends Array<any> = any[]> = <RequestType = R, Args extends Array<any> = A>(path: string, ...handlers: RequestHandler<RequestType, Args>[]) => IttyRouterType<RequestType, Args>;
export type Route<R = IRequest, A extends Array<any> = any[]> = <RequestType = R, Args extends Array<any> = A>(path: string, ...handlers: RequestHandler<RequestType, Args>[]) => IttyRouterType<R, A>;

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc