@vercel/routing-utils 6.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/types.d.ts +5 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetRoutesProps, NormalizedRoutes, Route, RouteWithHandle } from './types';
|
|
1
|
+
import { GetRoutesProps, NormalizedRoutes, Route, RouteInput, RouteWithHandle } from './types';
|
|
2
2
|
export { appendRoutesToPhase } from './append';
|
|
3
3
|
export { mergeRoutes } from './merge';
|
|
4
4
|
export { getOwnershipGuard, normalizeRoutePrefix, scopeRouteSourceToOwnership, } from './service-route-ownership';
|
|
@@ -9,5 +9,5 @@ declare const VALID_HANDLE_VALUES: readonly ["filesystem", "hit", "miss", "rewri
|
|
|
9
9
|
export type HandleValue = (typeof VALID_HANDLE_VALUES)[number];
|
|
10
10
|
export declare function isHandler(route: Route): route is RouteWithHandle;
|
|
11
11
|
export declare function isValidHandleValue(handle: string): handle is HandleValue;
|
|
12
|
-
export declare function normalizeRoutes(inputRoutes:
|
|
12
|
+
export declare function normalizeRoutes(inputRoutes: RouteInput[] | null): NormalizedRoutes;
|
|
13
13
|
export declare function getTransformedRoutes(vercelConfig: GetRoutesProps): NormalizedRoutes;
|
package/dist/types.d.ts
CHANGED
|
@@ -107,12 +107,16 @@ export type RouteWithHandle = {
|
|
|
107
107
|
status?: number;
|
|
108
108
|
};
|
|
109
109
|
export type Route = RouteWithSrc | RouteWithHandle;
|
|
110
|
+
export type RouteInput = RouteWithSrc | (Omit<RouteWithSrc, 'src'> & {
|
|
111
|
+
src?: undefined;
|
|
112
|
+
source: string;
|
|
113
|
+
}) | RouteWithHandle;
|
|
110
114
|
export type NormalizedRoutes = {
|
|
111
115
|
routes: Route[] | null;
|
|
112
116
|
error: RouteApiError | null;
|
|
113
117
|
};
|
|
114
118
|
export interface GetRoutesProps {
|
|
115
|
-
routes?:
|
|
119
|
+
routes?: RouteInput[];
|
|
116
120
|
cleanUrls?: boolean;
|
|
117
121
|
rewrites?: Rewrite[];
|
|
118
122
|
redirects?: Redirect[];
|