@eggjs/controller-decorator
Version:
tegg controller decorator
20 lines (19 loc) • 631 B
TypeScript
export declare class HTTPPriorityUtil {
static readonly DEFAULT_PRIORITY = 100000;
private static readonly TOKEN_PRIORITY;
/**
* | Path | RegExp index | priority |
* | --- | --- | --- |
* | /* | [0] | 0 |
* | /hello/:name | [1] | 1000 |
* | /hello/world/message/:message | [3] | 3000 |
* | /hello/:name/message/:message | [1, 3] | 4000 |
* | /hello/world | [] | 100000/Infinity? |
*
* priority = hasRegExp
* : regexpIndex.reduce((p,c) => p + c * 1000, 0)
* : 100000;
* @param {string} path -
*/
static calcPathPriority(path: string): number;
}