@tinkoff/router 0.2.12 → 0.2.13
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/lib/tree/tree.d.ts +1 -1
- package/lib/tree/utils.browser.js +1 -1
- package/lib/tree/utils.d.ts +1 -1
- package/lib/tree/utils.es.js +1 -1
- package/lib/tree/utils.js +1 -1
- package/lib/types.d.ts +4 -1
- package/package.json +1 -1
package/lib/tree/tree.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ const isWildcard = (part) => {
|
|
|
12
12
|
return WILDCARD_REGEXP.test(part);
|
|
13
13
|
};
|
|
14
14
|
const isParameterized = (part) => {
|
|
15
|
-
return part.match(PARAM_MATCH_REGEXP);
|
|
15
|
+
return !!part.match(PARAM_MATCH_REGEXP);
|
|
16
16
|
};
|
|
17
17
|
const parseParameter = (part) => {
|
|
18
18
|
const [prefix = '', param, postfix = ''] = part.split(PARAMETER_DELIMITER);
|
package/lib/tree/utils.d.ts
CHANGED
|
@@ -3,6 +3,6 @@ import type { Params } from '../types';
|
|
|
3
3
|
export declare const getParts: (pathname: string) => string[];
|
|
4
4
|
export declare const isHistoryFallback: (part: string) => boolean;
|
|
5
5
|
export declare const isWildcard: (part: string) => boolean;
|
|
6
|
-
export declare const isParameterized: (part: string) =>
|
|
6
|
+
export declare const isParameterized: (part: string) => boolean;
|
|
7
7
|
export declare const parse: (part: string) => ParsedPath;
|
|
8
8
|
export declare const makePath: (pathname: string, params: Params) => string;
|
package/lib/tree/utils.es.js
CHANGED
|
@@ -12,7 +12,7 @@ const isWildcard = (part) => {
|
|
|
12
12
|
return WILDCARD_REGEXP.test(part);
|
|
13
13
|
};
|
|
14
14
|
const isParameterized = (part) => {
|
|
15
|
-
return part.match(PARAM_MATCH_REGEXP);
|
|
15
|
+
return !!part.match(PARAM_MATCH_REGEXP);
|
|
16
16
|
};
|
|
17
17
|
const parseParameter = (part) => {
|
|
18
18
|
const [prefix = '', param, postfix = ''] = part.split(PARAMETER_DELIMITER);
|
package/lib/tree/utils.js
CHANGED
|
@@ -20,7 +20,7 @@ const isWildcard = (part) => {
|
|
|
20
20
|
return constants.WILDCARD_REGEXP.test(part);
|
|
21
21
|
};
|
|
22
22
|
const isParameterized = (part) => {
|
|
23
|
-
return part.match(constants.PARAM_MATCH_REGEXP);
|
|
23
|
+
return !!part.match(constants.PARAM_MATCH_REGEXP);
|
|
24
24
|
};
|
|
25
25
|
const parseParameter = (part) => {
|
|
26
26
|
const [prefix = '', param, postfix = ''] = part.split(constants.PARAMETER_DELIMITER);
|
package/lib/types.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { Url, Query } from '@tinkoff/url';
|
|
2
2
|
export type Params = Record<string, string>;
|
|
3
|
+
export interface RouteConfig {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
3
6
|
export interface Route {
|
|
4
7
|
name: string;
|
|
5
8
|
path: string;
|
|
6
9
|
redirect?: string | NavigateOptions;
|
|
7
10
|
alias?: string;
|
|
8
|
-
config?:
|
|
11
|
+
config?: RouteConfig;
|
|
9
12
|
}
|
|
10
13
|
export interface NavigationRoute extends Route {
|
|
11
14
|
actualPath: string;
|