New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@swan-io/chicane

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@swan-io/chicane - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

548

dist/createGroup.d.ts

@@ -17,3 +17,3 @@ export declare const createGroup: <GroupName extends string, BaseRoute extends string, Routes extends Record<string, string>>(name: GroupName, baseRoute: BaseRoute, routes: Readonly<Routes>) => { [K in keyof Routes as K extends string ? `${GroupName}${K}` : never]: `${((BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {

hash: "";
})["path"] extends `/${infer _}` ? (BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
})["path"] extends infer T ? T extends (BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;

@@ -34,3 +34,3 @@ search: Search;

hash: "";
})["path"] : `/${(BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
})["path"] ? T extends `/${string}` ? T : `/${T}` : never : never) extends infer T_1 ? T_1 extends ((BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;

@@ -51,102 +51,6 @@ search: Search;

hash: "";
})["path"]}`) extends "/" ? (Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
})["path"] extends infer T ? T extends (BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["path"] extends `/${infer _}` ? (Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["path"] : `/${(Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["path"]}` : ((Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["path"] extends `/${infer _}` ? (Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["path"] : `/${(Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["path"]}`) extends "/" ? (BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {

@@ -164,11 +68,11 @@ path: Path_1;

hash: "";
})["path"] extends `/${infer _}` ? (BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {
})["path"] ? T extends `/${string}` ? T : `/${T}` : never : never) ? T_1 extends "/" ? (Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : BaseRoute extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -178,14 +82,14 @@ search: "";

} : {
path: BaseRoute;
path: T_2;
search: "";
hash: "";
})["path"] : `/${(BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {
} : never : never)["path"] extends infer T_3 ? T_3 extends (Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : BaseRoute extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -195,14 +99,14 @@ search: "";

} : {
path: BaseRoute;
path: T_2;
search: "";
hash: "";
})["path"]}` : `${(BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {
} : never : never)["path"] ? T_3 extends `/${string}` ? T_3 : `/${T_3}` : never : never : ((Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : BaseRoute extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -212,14 +116,14 @@ search: "";

} : {
path: BaseRoute;
path: T_2;
search: "";
hash: "";
})["path"] extends `/${infer _}` ? (BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {
} : never : never)["path"] extends infer T_3 ? T_3 extends (Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : BaseRoute extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -229,14 +133,14 @@ search: "";

} : {
path: BaseRoute;
path: T_2;
search: "";
hash: "";
})["path"] : `/${(BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {
} : never : never)["path"] ? T_3 extends `/${string}` ? T_3 : `/${T_3}` : never : never) extends infer T_4 ? T_4 extends ((Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : BaseRoute extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -246,14 +150,14 @@ search: "";

} : {
path: BaseRoute;
path: T_2;
search: "";
hash: "";
})["path"]}`}${(Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
} : never : never)["path"] extends infer T_3 ? T_3 extends (Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -263,41 +167,9 @@ search: "";

} : {
path: Routes[K];
path: T_2;
search: "";
hash: "";
})["path"] extends `/${infer _}` ? (Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
} : never : never)["path"] ? T_3 extends `/${string}` ? T_3 : `/${T_3}` : never : never) ? T_4 extends "/" ? T_1 : `${T_1}${T_4}` : never : never : never : never}${((BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["path"] : `/${(Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["path"]}`}`}${((BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {

@@ -315,22 +187,6 @@ path: Path_1;

hash: "";
})["search"] extends "" ? (Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
})["search"] extends infer T_5 ? T_5 extends (BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["search"] : `${(BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {

@@ -348,11 +204,11 @@ path: Path_1;

hash: "";
})["search"]}${(Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
})["search"] ? T_5 extends "" ? (Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -362,14 +218,14 @@ search: "";

} : {
path: Routes[K];
path: T_2;
search: "";
hash: "";
})["search"] extends "" ? (Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
} : never : never)["search"] : `${T_5}${(Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -379,14 +235,14 @@ search: "";

} : {
path: Routes[K];
path: T_2;
search: "";
hash: "";
})["search"] : `&${(Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
} : never : never)["search"] extends infer T_6 ? T_6 extends (Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -396,6 +252,6 @@ search: "";

} : {
path: Routes[K];
path: T_2;
search: "";
hash: "";
})["search"]}`}`) extends "" ? "" & ((BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
} : never : never)["search"] ? T_6 extends "" ? T_6 : `&${T_6}` : never : never}` : never : never) extends infer T_7 ? T_7 extends ((BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;

@@ -416,22 +272,6 @@ search: Search;

hash: "";
})["search"] extends "" ? (Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
})["search"] extends infer T_5 ? T_5 extends (BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["search"] : `${(BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {

@@ -449,11 +289,11 @@ path: Path_1;

hash: "";
})["search"]}${(Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
})["search"] ? T_5 extends "" ? (Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -463,14 +303,14 @@ search: "";

} : {
path: Routes[K];
path: T_2;
search: "";
hash: "";
})["search"] extends "" ? (Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
} : never : never)["search"] : `${T_5}${(Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -480,14 +320,14 @@ search: "";

} : {
path: Routes[K];
path: T_2;
search: "";
hash: "";
})["search"] : `&${(Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
} : never : never)["search"] extends infer T_6 ? T_6 extends (Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -497,14 +337,14 @@ search: "";

} : {
path: Routes[K];
path: T_2;
search: "";
hash: "";
})["search"]}`}`) : `?${(BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {
} : never : never)["search"] ? T_6 extends "" ? T_6 : `&${T_6}` : never : never}` : never : never) ? T_7 extends "" ? T_7 : `?${T_7}` : never : never}${((Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : BaseRoute extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -514,25 +354,9 @@ search: "";

} : {
path: BaseRoute;
path: T_2;
search: "";
hash: "";
})["search"] extends "" ? (Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
} : never : never)["hash"] extends "" ? (BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["search"] : `${(BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {

@@ -550,11 +374,11 @@ path: Path_1;

hash: "";
})["search"]}${(Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
})["hash"] : (Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -564,14 +388,14 @@ search: "";

} : {
path: Routes[K];
path: T_2;
search: "";
hash: "";
})["search"] extends "" ? (Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
} : never : never)["hash"]) extends infer T_8 ? T_8 extends ((Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -581,41 +405,9 @@ search: "";

} : {
path: Routes[K];
path: T_2;
search: "";
hash: "";
})["search"] : `&${(Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
} : never : never)["hash"] extends "" ? (BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["search"]}`}`}`}${((Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["hash"] extends "" ? (BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {

@@ -633,11 +425,11 @@ path: Path_1;

hash: "";
})["hash"] : (Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
})["hash"] : (Routes[K] extends infer T_2 ? T_2 extends Routes[K] ? T_2 extends `${string}?${string}#${string}` ? {
path: string;
search: string;
hash: string;
} : T_2 extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
} : T_2 extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;

@@ -647,101 +439,5 @@ search: "";

} : {
path: Routes[K];
path: T_2;
search: "";
hash: "";
})["hash"]) extends "" ? "" & ((Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["hash"] extends "" ? (BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : BaseRoute extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: BaseRoute;
search: "";
hash: "";
})["hash"] : (Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["hash"]) : `#${(Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["hash"] extends "" ? (BaseRoute extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : BaseRoute extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : BaseRoute extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: BaseRoute;
search: "";
hash: "";
})["hash"] : (Routes[K] extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;
search: Search;
hash: Hash;
} : Routes[K] extends `${infer Path_1}?${infer Search_1}` ? {
path: Path_1;
search: Search_1;
hash: "";
} : Routes[K] extends `${infer Path_2}#${infer Hash_1}` ? {
path: Path_2;
search: "";
hash: Hash_1;
} : {
path: Routes[K];
search: "";
hash: "";
})["hash"]}`}`; };
} : never : never)["hash"]) ? T_8 extends "" ? T_8 : `#${T_8}` : never : never}`; };

@@ -188,3 +188,3 @@ import { ExtractRoutesParams, GetAreaRoutes, ParamsArg, PrependBasePath, Simplify } from "./types";

}>>>>[RouteName_2]>) => void;
} & { [RouteName_3 in keyof Omit<PrependBasePath<BasePath, Routes, BasePath extends `${infer Path}?${infer Search}#${infer Hash}` ? {
} & (Omit<PrependBasePath<BasePath, Routes, BasePath extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;

@@ -221,3 +221,3 @@ search: Search;

hash: "";
}>>>]: (...args: ParamsArg<ExtractRoutesParams<Omit<PrependBasePath<BasePath, Routes, BasePath extends `${infer Path}?${infer Search}#${infer Hash}` ? {
}>>> extends infer T ? { [RouteName_3 in keyof T]: (...args: ParamsArg<ExtractRoutesParams<Omit<PrependBasePath<BasePath, Routes, BasePath extends `${infer Path}?${infer Search}#${infer Hash}` ? {
path: Path;

@@ -254,2 +254,2 @@ search: Search;

hash: "";
}>>>>[RouteName_3]>) => string; };
}>>>>[RouteName_3]>) => string; } : never);

@@ -8,5 +8,5 @@ export declare const first: <T>(value: T[]) => T | undefined;

key: string;
} | undefined, routeB?: {
}, routeB?: {
key: string;
} | undefined) => boolean;
}) => boolean;
export declare const isMultipleParam: (value: string) => boolean;

@@ -1,2 +0,2 @@

var e=require("history"),r=require("react"),t=require("use-sync-external-store/shim/with-selector"),n=require("use-sync-external-store/shim"),a=require("@emotion/hash");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,r}var u=/*#__PURE__*/i(r),c=/*#__PURE__*/o(a),s=function(e,r){return""===e?e:r+e},l=function(e){return"/"===e[0]?e:"/"+e},h=function(r){var t=e.parsePath(r),n=t.pathname,a=t.search,o=t.hash,i=void 0===o?"":o;return{path:void 0===n?"":n,search:(void 0===a?"":a).substring(1),hash:i.substring(1)}},f=function(e,r){var t=l(e.path),n=l(r.path),a="/"===t?n:"/"===n?t:t+n,o=""===e.search?r.search:e.search+s(r.search,"&"),i=""===r.hash?e.hash:r.hash;return a+s(o,"?")+s(i,"#")};function p(){return p=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},p.apply(this,arguments)}function v(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function d(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return v(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?v(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var y=function(e){return e[0]},m=function(e){return e},g=function(e){return""!==e},b=function(e){return e.startsWith(":")},w=function(e,r){return e.length===r.length&&e.every(function(e,t){return e===r[t]})},S=function(e,r){return(null==e?void 0:e.key)===(null==r?void 0:r.key)},k=function(e){for(var r,t={},n=d(new URLSearchParams(e));!(r=n()).done;){var a=r.value,o=a[0],i=a[1],u=t[o];t[o]=null!=u?"string"==typeof u?[u,i]:u.concat(i):i}return t},O=function(e,r,t){var n=e+(""!==e?"&":"")+encodeURIComponent(r);return""!==t?n+"="+encodeURIComponent(t):n},P=function(e){var r=Object.keys(e);if(0===r.length)return"";var t="";r.sort();for(var n=0,a=r;n<a.length;n++){var o=a[n],i=e[o];if(null!=i)if("string"==typeof i)t=O(t,o,i);else for(var u,c=d(i);!(u=c()).done;)t=O(t,o,u.value)}return""===t?"":"?"+t},x=function(e,r){var t=e.search,n=e.hash,a=e.pathname.substring(1),o=""!==a?r?a.split("/").filter(g).map(decodeURIComponent):a.split("/").map(decodeURIComponent):[],i=""!==t?k(t):{},u=""!==n?decodeURIComponent(n.substring(1)):null,s="/"+o.map(encodeURIComponent).join("/"),l=P(i),h=null!=u?"#"+encodeURIComponent(u):"",f=s+l+h;return p({key:c.default(s)+"-"+c.default(l+h),path:o,search:i},null!==u&&{hash:u},{raw:{path:s,search:l,hash:h},toString:function(){return f}})},C=new Set,j="undefined"!=typeof window&&window.document&&window.document.createElement?e.createBrowserHistory():e.createMemoryHistory(),R=x(j.location,!0),U=!1;R.toString()!==e.createPath(j.location)&&j.replace(R.toString()),j.listen(function(e){var r=x(e.location,!1);if(r.toString()!==R.toString()){U=!0;var t=r.raw.search!==R.raw.search,n=t?{}:R.search;if(t)for(var a in r.search)if(Object.prototype.hasOwnProperty.call(r.search,a)){var o=r.search[a];if(null==o)continue;var i=R.search[a];n[a]=null!=i&&"string"!=typeof i&&"string"!=typeof o&&w(o,i)?i:o}R=p({key:r.key,path:r.raw.path!==R.raw.path?r.path:R.path,search:n},null!=r.hash&&{hash:r.hash},{raw:r.raw,toString:r.toString}),C.forEach(function(e){return e(R)})}});var I=function(e){return C.add(e),function(){C.delete(e)}},A=function(){return R},E=u.createContext(A),N=E.Provider,L=function(){return u.useContext(E)},q=function(r){var t=e.parsePath(r),n=t.pathname,a=t.search,o=t.hash;j.push({pathname:void 0===n?"":n,search:void 0===a?"":a,hash:void 0===o?"":o})},T=function(r){var t=e.parsePath(r),n=t.pathname,a=t.search,o=t.hash;j.replace({pathname:void 0===n?"":n,search:void 0===a?"":a,hash:void 0===o?"":o})},M=function(e){for(var r,t=e.split("/").filter(g),n=[],a=t.length>0?4*t.length:5,o=d(t);!(r=o()).done;){var i=r.value,u=b(i);a+=u?2:3,n.push(u?{name:i.substring(1)}:encodeURIComponent(i))}return{ranking:a,path:n}},W=function(r,t){if(t.endsWith("/*")){var n=e.parsePath(t.slice(0,-2)).pathname,a=M(void 0===n?"/":n);return{isArea:!0,name:r,ranking:a.ranking-1,path:a.path,search:{},hash:void 0}}for(var o,i=e.parsePath(t),u=i.pathname,c=i.search,s=void 0===c?"":c,l=i.hash,h=void 0===l?"":l,f=M(void 0===u?"/":u),p=f.ranking,v=f.path,y={},m=d(new URLSearchParams(s.substring(1)));!(o=m()).done;){var g=o.value[0];(w=g).startsWith(":")&&w.endsWith("[]")?y[g.substring(1,g.length-2)]="multiple":b(g)&&(y[g.substring(1,g.length)]="unique")}return{isArea:!1,name:r,ranking:p,path:v,search:y,hash:b(h.substring(1))?h.substring(2):void 0};var w},K=function(e,r){var t=e.path,n=r.isArea,a=r.path;if(!(!n&&t.length!==a.length||n&&t.length<a.length)){for(var o={},i=0;i<a.length;i++){var u=t[i],c=a[i];if(null!=c)if("string"==typeof c){if(c!==u)return}else{if(null==u)return;o[c.name]=u}}if(n)return o;for(var s in r.search)if(Object.prototype.hasOwnProperty.call(r.search,s)){var l=r.search[s],h=e.search[s];if(null==l||null==h)continue;if("multiple"===l){o[s]="string"==typeof h?[h]:h;continue}"string"==typeof h?o[s]=h:null!=h[0]&&(o[s]=h[0])}return null!=r.hash&&null!=e.hash&&(o[r.hash]=e.hash),o}},_=function(e,r){void 0===r&&(r={});var t="/"+e.path.map(function(e){return encodeURIComponent("string"==typeof e?e:String(r[e.name]))}).join("/"),n="",a="";if(null!=e.search){var o={};for(var i in r){var u=r[i];Object.prototype.hasOwnProperty.call(r,i)&&Object.prototype.hasOwnProperty.call(e.search,i)&&null!=u&&(o[i]=u)}n=P(o)}if(null!=e.hash){var c=r[e.hash];"string"==typeof c&&(a="#"+encodeURIComponent(c))}return{pathname:t,search:n,hash:a}},B=function(r){var t=r.href,a=r.replace,o=void 0!==a&&a,i=r.target,c=L(),s=u.useMemo(function(){return e.parsePath(t).pathname},[t]),l=n.useSyncExternalStore(I,function(){return s===c().raw.path}),h=o||l,f=!i||"_self"===i;return{active:l,onClick:u.useCallback(function(e){e.defaultPrevented||!f||0!==e.button||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||(e.preventDefault(),h?T(t):q(t))},[h,f,t])}},D=["onClick","className","replace","style","target","to","activeClassName","activeStyle"],H=u.forwardRef(function(e,r){var t=e.onClick,n=e.className,a=e.replace,o=e.style,i=e.target,c=e.to,s=e.activeClassName,l=e.activeStyle,h=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r.indexOf(t=o[n])>=0||(a[t]=e[t]);return a}(e,D),f=B({href:c,replace:a,target:i}),v=f.active,d=f.onClick;return u.createElement("a",p({},h,{ref:r,href:c,onClick:function(e){null==t||t(e),d(e)},target:i,className:v&&null!=s?null==n?s:n+" "+s:n,style:v&&null!=l?null==o?l:p({},o,l):o}))});H.displayName="Link";var F={A:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0};exports.Link=H,exports.ServerUrlProvider=function(r){var t=r.children,n=e.parsePath(r.value),a=n.pathname,o=n.search,i=n.hash,c=x({pathname:void 0===a?"/":a,search:void 0===o?"":o,hash:void 0===i?"":i},!1);return u.createElement(N,{children:t,value:function(){return c}})},exports.createGroup=function(e,r,t){var n=h(r),a={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(a[e+o]=f(n,h(t[o])));return a},exports.createRouter=function(r,n){void 0===n&&(n={});var a=n.basePath,o=void 0===a?"":a,i={path:h(o).path,search:"",hash:""},c={},s=[];for(var l in r)if(Object.prototype.hasOwnProperty.call(r,l)){var v=W(l,""!==o?f(i,h(r[l])):r[l]);c[l]=v,s.push(v)}s.sort(function(e,r){return r.ranking-e.ranking});for(var g={},b=0;b<s.length;b++){var w=s[b];null==w||w.isArea||function(){var r=w.name;g[r]=function(t){return e.createPath(_(c[r],t))}}()}return p({useRoute:function(e){var r=L(),n=u.useMemo(function(){return s.filter(function(r){return e.includes(r.name)})},[JSON.stringify(e)]);return t.useSyncExternalStoreWithSelector(I,function(){return function(e,r){for(var t,n=d(r);!(t=n()).done;){var a=t.value,o=K(e,a);if(null!=o)return{key:e.key,name:a.name,params:o}}}(r(),n)},void 0,m,S)},push:function(e){return j.push(_(c[e],y([].slice.call(arguments,1))))},replace:function(e){return j.replace(_(c[e],y([].slice.call(arguments,1))))}},g)},exports.decodeSearch=k,exports.encodeSearch=P,exports.getLocation=A,exports.pushUnsafe=q,exports.replaceUnsafe=T,exports.subscribeToLocation=I,exports.useFocusReset=function(e){var r=e.route,t=e.containerRef,n=null==r?void 0:r.key.split("-")[0];u.useEffect(function(){var e=t.current;if(e&&U)try{null!=e.getAttribute("tabIndex")||F[e.nodeName]||e.setAttribute("tabIndex","-1"),e.focus()}catch(e){}},[t,n])},exports.useLinkProps=B,exports.useLocation=function(){var e=L();return n.useSyncExternalStore(I,e)},exports.useNavigationBlocker=function(e,r){u.useEffect(function(){if(e){var t=j.block(function(e){window.confirm(r)&&(t(),e.retry())});return t}},[e])};
var e=require("history"),r=require("react"),t=require("use-sync-external-store/shim/with-selector"),n=require("use-sync-external-store/shim"),a=require("@emotion/hash");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach(function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),r.default=e,r}var u=/*#__PURE__*/i(r),c=/*#__PURE__*/o(a),s=function(e,r){return""===e?e:r+e},l=function(e){return"/"===e[0]?e:"/"+e},h=function(r){var t=e.parsePath(r),n=t.pathname,a=t.search,o=t.hash,i=void 0===o?"":o;return{path:void 0===n?"":n,search:(void 0===a?"":a).substring(1),hash:i.substring(1)}},f=function(e,r){var t=l(e.path),n=l(r.path),a="/"===t?n:"/"===n?t:t+n,o=""===e.search?r.search:e.search+s(r.search,"&"),i=""===r.hash?e.hash:r.hash;return a+s(o,"?")+s(i,"#")};function p(){return p=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},p.apply(this,arguments)}function v(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function d(e,r){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,r){if(e){if("string"==typeof e)return v(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?v(e,r):void 0}}(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var y=function(e){return e[0]},m=function(e){return e},g=function(e){return""!==e},b=function(e){return e.startsWith(":")},w=function(e,r){return e.length===r.length&&e.every(function(e,t){return e===r[t]})},S=function(e,r){return(null==e?void 0:e.key)===(null==r?void 0:r.key)},k=function(e){for(var r,t={},n=d(new URLSearchParams(e));!(r=n()).done;){var a=r.value,o=a[0],i=a[1],u=t[o];t[o]=null!=u?"string"==typeof u?[u,i]:u.concat(i):i}return t},O=function(e,r,t){var n=e+(""!==e?"&":"")+encodeURIComponent(r);return""!==t?n+"="+encodeURIComponent(t):n},P=function(e){var r=Object.keys(e);if(0===r.length)return"";var t="";r.sort();for(var n=0,a=r;n<a.length;n++){var o=a[n],i=e[o];if(null!=i)if("string"==typeof i)t=O(t,o,i);else for(var u,c=d(i);!(u=c()).done;)t=O(t,o,u.value)}return""===t?"":"?"+t},x=function(e,r){var t=e.search,n=e.hash,a=e.pathname.substring(1),o=""!==a?r?a.split("/").filter(g).map(decodeURIComponent):a.split("/").map(decodeURIComponent):[],i=""!==t?k(t):{},u=""!==n?decodeURIComponent(n.substring(1)):null,s="/"+o.map(encodeURIComponent).join("/"),l=P(i),h=null!=u?"#"+encodeURIComponent(u):"",f=s+l+h;return p({key:c.default(s)+"-"+c.default(l+h),path:o,search:i},null!==u&&{hash:u},{raw:{path:s,search:l,hash:h},toString:function(){return f}})},C=new Set,j="undefined"!=typeof window&&window.document&&window.document.createElement?e.createBrowserHistory():e.createMemoryHistory(),R=x(j.location,!0),U=!1;R.toString()!==e.createPath(j.location)&&j.replace(R.toString()),j.listen(function(e){var r=x(e.location,!1);if(r.toString()!==R.toString()){U=!0;var t=r.raw.search!==R.raw.search,n=t?{}:R.search;if(t)for(var a in r.search)if(Object.prototype.hasOwnProperty.call(r.search,a)){var o=r.search[a];if(null==o)continue;var i=R.search[a];n[a]=null!=i&&"string"!=typeof i&&"string"!=typeof o&&w(o,i)?i:o}R=p({key:r.key,path:r.raw.path!==R.raw.path?r.path:R.path,search:n},null!=r.hash&&{hash:r.hash},{raw:r.raw,toString:r.toString}),C.forEach(function(e){return e(R)})}});var I=function(e){return C.add(e),function(){C.delete(e)}},A=function(){return R},E=u.createContext(A),N=E.Provider,L=function(){return u.useContext(E)},q=function(r){var t=e.parsePath(r),n=t.pathname,a=t.search,o=t.hash;j.push({pathname:void 0===n?"":n,search:void 0===a?"":a,hash:void 0===o?"":o})},T=function(r){var t=e.parsePath(r),n=t.pathname,a=t.search,o=t.hash;j.replace({pathname:void 0===n?"":n,search:void 0===a?"":a,hash:void 0===o?"":o})},M=function(e){for(var r,t=e.split("/").filter(g),n=[],a=t.length>0?4*t.length:5,o=d(t);!(r=o()).done;){var i=r.value,u=b(i);a+=u?2:3,n.push(u?{name:i.substring(1)}:encodeURIComponent(i))}return{ranking:a,path:n}},W=function(r,t){if(t.endsWith("/*")){var n=e.parsePath(t.slice(0,-2)).pathname,a=M(void 0===n?"/":n);return{isArea:!0,name:r,ranking:a.ranking-1,path:a.path,search:{},hash:void 0}}for(var o,i=e.parsePath(t),u=i.pathname,c=i.search,s=void 0===c?"":c,l=i.hash,h=void 0===l?"":l,f=M(void 0===u?"/":u),p=f.ranking,v=f.path,y={},m=d(new URLSearchParams(s.substring(1)));!(o=m()).done;){var g=o.value[0];(w=g).startsWith(":")&&w.endsWith("[]")?y[g.substring(1,g.length-2)]="multiple":b(g)&&(y[g.substring(1,g.length)]="unique")}return{isArea:!1,name:r,ranking:p,path:v,search:y,hash:b(h.substring(1))?h.substring(2):void 0};var w},K=function(e,r){var t=e.path,n=r.isArea,a=r.path;if(!(!n&&t.length!==a.length||n&&t.length<a.length)){for(var o={},i=0;i<a.length;i++){var u=t[i],c=a[i];if(null!=c)if("string"==typeof c){if(c!==u)return}else{if(null==u)return;o[c.name]=u}}if(n)return o;for(var s in r.search)if(Object.prototype.hasOwnProperty.call(r.search,s)){var l=r.search[s],h=e.search[s];if(null==l||null==h)continue;if("multiple"===l){o[s]="string"==typeof h?[h]:h;continue}"string"==typeof h?o[s]=h:null!=h[0]&&(o[s]=h[0])}return null!=r.hash&&null!=e.hash&&(o[r.hash]=e.hash),o}},_=function(e,r){void 0===r&&(r={});var t="/"+e.path.map(function(e){return encodeURIComponent("string"==typeof e?e:String(r[e.name]))}).join("/"),n="",a="";if(null!=e.search){var o={};for(var i in r){var u=r[i];Object.prototype.hasOwnProperty.call(r,i)&&Object.prototype.hasOwnProperty.call(e.search,i)&&null!=u&&(o[i]=u)}n=P(o)}if(null!=e.hash){var c=r[e.hash];"string"==typeof c&&(a="#"+encodeURIComponent(c))}return{pathname:t,search:n,hash:a}},B=function(r){var t=r.href,a=r.replace,o=void 0!==a&&a,i=r.target,c=L(),s=u.useMemo(function(){return e.parsePath(t).pathname},[t]),l=n.useSyncExternalStore(I,function(){return s===c().raw.path}),h=o||l,f=!i||"_self"===i;return{active:l,onClick:u.useCallback(function(e){e.defaultPrevented||!f||0!==e.button||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||(e.preventDefault(),h?T(t):q(t))},[h,f,t])}},D=["onClick","className","replace","style","target","to","activeClassName","activeStyle"],H=u.forwardRef(function(e,r){var t=e.onClick,n=e.className,a=e.replace,o=e.style,i=e.target,c=e.to,s=e.activeClassName,l=e.activeStyle,h=function(e,r){if(null==e)return{};var t,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r.indexOf(t=o[n])>=0||(a[t]=e[t]);return a}(e,D),f=B({href:c,replace:a,target:i}),v=f.active,d=f.onClick;return u.createElement("a",p({},h,{ref:r,href:c,onClick:function(e){null==t||t(e),d(e)},target:i,className:v&&null!=s?null==n?s:n+" "+s:n,style:v&&null!=l?null==o?l:p({},o,l):o}))});H.displayName="Link";var F={A:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0};exports.Link=H,exports.ServerUrlProvider=function(r){var t=r.children,n=e.parsePath(r.value),a=n.pathname,o=n.search,i=n.hash,c=x({pathname:void 0===a?"/":a,search:void 0===o?"":o,hash:void 0===i?"":i},!1);return u.createElement(N,{children:t,value:function(){return c}})},exports.createGroup=function(e,r,t){var n=h(r),a={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(a[e+o]=f(n,h(t[o])));return a},exports.createRouter=function(r,n){void 0===n&&(n={});var a=n.basePath,o=void 0===a?"":a,i={path:h(o).path,search:"",hash:""},c={},s=[];for(var l in r)if(Object.prototype.hasOwnProperty.call(r,l)){var v=W(l,""!==o?f(i,h(r[l])):r[l]);c[l]=v,s.push(v)}s.sort(function(e,r){return r.ranking-e.ranking});for(var g={},b=0;b<s.length;b++){var w=s[b];null==w||w.isArea||function(){var r=w.name;g[r]=function(t){return e.createPath(_(c[r],t))}}()}return p({useRoute:function(e){var r=L(),n=u.useMemo(function(){return s.filter(function(r){return e.includes(r.name)})},[JSON.stringify(e)]);return t.useSyncExternalStoreWithSelector(I,function(){return function(e,r){for(var t,n=d(r);!(t=n()).done;){var a=t.value,o=K(e,a);if(null!=o)return{key:e.key,name:a.name,params:o}}}(r(),n)},void 0,m,S)},push:function(e){return j.push(_(c[e],y([].slice.call(arguments,1))))},replace:function(e){return j.replace(_(c[e],y([].slice.call(arguments,1))))}},g)},exports.decodeSearch=k,exports.encodeSearch=P,exports.getLocation=A,exports.pushUnsafe=q,exports.replaceUnsafe=T,exports.subscribeToLocation=I,exports.useFocusReset=function(e){var r=e.route,t=e.containerRef,n=null==r?void 0:r.key.split("-")[0];u.useEffect(function(){var e=t.current;if(e&&U)try{null!=e.getAttribute("tabIndex")||F[e.nodeName]||e.setAttribute("tabIndex","-1"),e.focus()}catch(e){}},[t,n])},exports.useLinkProps=B,exports.useLocation=function(){var e=L();return n.useSyncExternalStore(I,e)},exports.useNavigationBlocker=function(e,r){u.useEffect(function(){if(e){var t=j.block(function(e){window.confirm(r)&&(t(),e.retry())});return t}},[e])};
//# sourceMappingURL=index.js.map
{
"name": "@swan-io/chicane",
"version": "1.2.0",
"version": "1.2.1",
"license": "MIT",

@@ -34,16 +34,12 @@ "description": "A simple and safe router for React and TypeScript",

"format": "prettier '**/*' -u -w",
"test": "jest",
"test:watch": "jest --watch",
"test": "vitest --run",
"test:watch": "vitest --watch",
"tscheck": "tsc --noEmit",
"prepare": "yarn test && yarn build"
},
"jest": {
"setupFilesAfterEnv": [
"<rootDir>/jest-setup.ts"
],
"testEnvironment": "jsdom",
"testPathIgnorePatterns": [
"<rootDir>/__tests__/utils.ts"
]
},
"browserslist": [
">0.2%",
"not op_mini all",
"not dead"
],
"prettier": {

@@ -58,25 +54,18 @@ "trailingComma": "all"

"history": "^5.3.0",
"use-sync-external-store": "^1.1.0"
"use-sync-external-store": "^1.2.0"
},
"devDependencies": {
"@babel/core": "^7.18.0",
"@babel/plugin-transform-react-jsx": "^7.17.12",
"@babel/preset-env": "^7.18.0",
"@babel/preset-typescript": "^7.17.12",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.1.5",
"@types/jest": "^27.5.1",
"@types/react": "^17.0.45",
"@types/react-dom": "^17.0.17",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"@types/use-sync-external-store": "^0.0.3",
"babel-jest": "^28.1.0",
"jest": "^28.1.0",
"jest-environment-jsdom": "^28.1.0",
"jsdom": "^20.0.0",
"microbundle": "^0.15.0",
"prettier": "2.6.2",
"prettier-plugin-organize-imports": "^2.3.4",
"prettier": "^2.7.1",
"prettier-plugin-organize-imports": "^3.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.6.4"
"typescript": "^4.7.4",
"vitest": "^0.17.0"
}
}

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