From: Eduardo San Martin Morote Date: Fri, 30 Jul 2021 10:13:34 +0000 (+0200) Subject: chore: comments X-Git-Tag: v4.0.11~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71c2360752b05e2c776b424b5f3220af3b6ee978;p=thirdparty%2Fvuejs%2Frouter.git chore: comments --- diff --git a/rollup.config.js b/rollup.config.js index b012c5c2..d1e16628 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -167,7 +167,6 @@ function createReplacePlugin( replacements[key] = process.env[key] } }) - // TODO: fix replacement thing return replace({ preventAssignment: true, values: replacements, diff --git a/src/matcher/pathParserRanker.ts b/src/matcher/pathParserRanker.ts index 0a848ffd..6c5d0fdb 100644 --- a/src/matcher/pathParserRanker.ts +++ b/src/matcher/pathParserRanker.ts @@ -17,10 +17,12 @@ export interface PathParser { * The regexp used to match a url */ re: RegExp + /** * The score of the parser */ score: Array + /** * Keys that appeared in the path */ @@ -35,6 +37,7 @@ export interface PathParser { * no match */ parse(path: string): PathParams | null + /** * Creates a string version of the url * @@ -52,15 +55,18 @@ export interface _PathParserOptions { * Makes the RegExp case sensitive. Defaults to false */ sensitive?: boolean + /** * Should we disallow a trailing slash. Defaults to false */ strict?: boolean + /** * Should the RegExp match from the beginning by prepending a `^` to it. Defaults to true * @internal */ start?: boolean + /** * Should the RegExp match until the end by appending a `$` to it. Defaults to true */ @@ -274,6 +280,7 @@ export function tokensToParser( /** * Compares an array of numbers as used in PathParser.score and returns a * number. This function can be used to `sort` an array + * * @param a - first array of numbers * @param b - second array of numbers * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b @@ -306,6 +313,7 @@ function compareScoreArray(a: number[], b: number[]): number { /** * Compare function that can be used with `sort` to sort an array of PathParser + * * @param a - first PathParser * @param b - second PathParser * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b