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

universal-router

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

universal-router - npm Package Compare versions

Comparing version 9.1.0 to 9.2.0

2

generateUrls/package.json
{
"private": true,
"name": "generateUrls",
"version": "9.1.0",
"version": "9.2.0",
"description": "Universal Router Generate URLs Add-on",

@@ -6,0 +6,0 @@ "homepage": "https://www.kriasoft.com/universal-router/",

{
"name": "universal-router",
"version": "9.1.0",
"version": "9.2.0",
"description": "Isomorphic router for JavaScript web applications",

@@ -5,0 +5,0 @@ "homepage": "https://www.kriasoft.com/universal-router/",

@@ -28,3 +28,3 @@ /**

declare const generateUrl: (routeName: string, params?: UrlParams) => string;
declare type GenerateUrl = typeof generateUrl;
type GenerateUrl = typeof generateUrl;
/**

@@ -31,0 +31,0 @@ * Create a function to generate urls by route names.

@@ -29,3 +29,3 @@ /**

}
export declare type RouteResult<T> = T | null | undefined | Promise<T | null | undefined>;
export type RouteResult<T> = T | null | undefined | Promise<T | null | undefined>;
export interface RouteContext<R = any, C extends RouterContext = RouterContext> extends ResolveContext {

@@ -97,8 +97,8 @@ /**

*/
export declare type Routes<R = any, C extends RouterContext = RouterContext> = Array<Route<R, C>>;
export declare type ResolveRoute<R = any, C extends RouterContext = RouterContext> = (context: RouteContext<R, C>, params: RouteParams) => RouteResult<R>;
export declare type RouteError = Error & {
export type Routes<R = any, C extends RouterContext = RouterContext> = Array<Route<R, C>>;
export type ResolveRoute<R = any, C extends RouterContext = RouterContext> = (context: RouteContext<R, C>, params: RouteParams) => RouteResult<R>;
export type RouteError = Error & {
status?: number;
};
export declare type ErrorHandler<R = any> = (error: RouteError, context: ResolveContext) => RouteResult<R>;
export type ErrorHandler<R = any> = (error: RouteError, context: ResolveContext) => RouteResult<R>;
export interface RouterOptions<R = any, C extends RouterContext = RouterContext> extends ParseOptions, TokensToRegexpOptions, RegexpToFunctionOptions {

@@ -105,0 +105,0 @@ context?: C;

@@ -149,3 +149,3 @@ /**

function matchRoute<R, C>(
function matchRoute<R, C extends RouterContext>(
route: Route<R, C>,

@@ -152,0 +152,0 @@ baseUrl: string,

@@ -29,3 +29,3 @@ /**

}
export declare type RouteResultSync<T> = T | null | undefined;
export type RouteResultSync<T> = T | null | undefined;
export interface RouteContext<R = any, C extends RouterContext = RouterContext> extends ResolveContext {

@@ -95,8 +95,8 @@ /**

*/
export declare type Routes<R = any, C extends RouterContext = RouterContext> = Array<Route<R, C>>;
export declare type ResolveRoute<R = any, C extends RouterContext = RouterContext> = (context: RouteContext<R, C>, params: RouteParams) => RouteResultSync<R>;
export declare type RouteError = Error & {
export type Routes<R = any, C extends RouterContext = RouterContext> = Array<Route<R, C>>;
export type ResolveRoute<R = any, C extends RouterContext = RouterContext> = (context: RouteContext<R, C>, params: RouteParams) => RouteResultSync<R>;
export type RouteError = Error & {
status?: number;
};
export declare type ErrorHandler<R = any> = (error: RouteError, context: ResolveContext) => RouteResultSync<R>;
export type ErrorHandler<R = any> = (error: RouteError, context: ResolveContext) => RouteResultSync<R>;
export interface RouterOptions<R = any, C extends RouterContext = RouterContext> extends ParseOptions, TokensToRegexpOptions, RegexpToFunctionOptions {

@@ -103,0 +103,0 @@ context?: C;

@@ -150,3 +150,3 @@ /**

function matchRoute<R, C>(
function matchRoute<R, C extends RouterContext>(
route: Route<R, C>,

@@ -328,3 +328,3 @@ baseUrl: string,

if (this.options.errorHandler) {
return this.options.errorHandler(error, currentContext)
return this.options.errorHandler(error as RouteError, currentContext)
}

@@ -331,0 +331,0 @@ throw error

{
"private": true,
"name": "sync",
"version": "9.1.0",
"version": "9.2.0",
"description": "Universal Router Sync Add-on",

@@ -6,0 +6,0 @@ "homepage": "https://www.kriasoft.com/universal-router/",

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

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

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