From 4de734b86d5476d6111acb3111fe39b9fb4cac6f Mon Sep 17 00:00:00 2001 From: eps1lon Date: Fri, 2 Aug 2024 22:05:57 +0200 Subject: [PATCH] Check vendored `path-to-regexp` into version control --- .../next/src/compiled/path-to-regexp/index.js | 406 +++ .../src/compiled/path-to-regexp/index.js.map | 1 + .../src/compiled/path-to-regexp/index.spec.js | 2737 +++++++++++++++++ .../compiled/path-to-regexp/index.spec.js.map | 1 + .../src/compiled/path-to-regexp/package.json | 86 + packages/next/taskfile.js | 5 +- 6 files changed, 3235 insertions(+), 1 deletion(-) create mode 100644 packages/next/src/compiled/path-to-regexp/index.js create mode 100644 packages/next/src/compiled/path-to-regexp/index.js.map create mode 100644 packages/next/src/compiled/path-to-regexp/index.spec.js create mode 100644 packages/next/src/compiled/path-to-regexp/index.spec.js.map create mode 100644 packages/next/src/compiled/path-to-regexp/package.json diff --git a/packages/next/src/compiled/path-to-regexp/index.js b/packages/next/src/compiled/path-to-regexp/index.js new file mode 100644 index 0000000000000..8b9a4edb552bd --- /dev/null +++ b/packages/next/src/compiled/path-to-regexp/index.js @@ -0,0 +1,406 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Tokenize input string. + */ +function lexer(str) { + var tokens = []; + var i = 0; + while (i < str.length) { + var char = str[i]; + if (char === "*" || char === "+" || char === "?") { + tokens.push({ type: "MODIFIER", index: i, value: str[i++] }); + continue; + } + if (char === "\\") { + tokens.push({ type: "ESCAPED_CHAR", index: i++, value: str[i++] }); + continue; + } + if (char === "{") { + tokens.push({ type: "OPEN", index: i, value: str[i++] }); + continue; + } + if (char === "}") { + tokens.push({ type: "CLOSE", index: i, value: str[i++] }); + continue; + } + if (char === ":") { + var name = ""; + var j = i + 1; + while (j < str.length) { + var code = str.charCodeAt(j); + if ( + // `0-9` + (code >= 48 && code <= 57) || + // `A-Z` + (code >= 65 && code <= 90) || + // `a-z` + (code >= 97 && code <= 122) || + // `_` + code === 95) { + name += str[j++]; + continue; + } + break; + } + if (!name) + throw new TypeError("Missing parameter name at " + i); + tokens.push({ type: "NAME", index: i, value: name }); + i = j; + continue; + } + if (char === "(") { + var count = 1; + var pattern = ""; + var j = i + 1; + if (str[j] === "?") { + throw new TypeError("Pattern cannot start with \"?\" at " + j); + } + while (j < str.length) { + if (str[j] === "\\") { + pattern += str[j++] + str[j++]; + continue; + } + if (str[j] === ")") { + count--; + if (count === 0) { + j++; + break; + } + } + else if (str[j] === "(") { + count++; + if (str[j + 1] !== "?") { + throw new TypeError("Capturing groups are not allowed at " + j); + } + } + pattern += str[j++]; + } + if (count) + throw new TypeError("Unbalanced pattern at " + i); + if (!pattern) + throw new TypeError("Missing pattern at " + i); + tokens.push({ type: "PATTERN", index: i, value: pattern }); + i = j; + continue; + } + tokens.push({ type: "CHAR", index: i, value: str[i++] }); + } + tokens.push({ type: "END", index: i, value: "" }); + return tokens; +} +/** + * Parse a string for the raw tokens. + */ +function parse(str, options) { + if (options === void 0) { options = {}; } + var tokens = lexer(str); + var _a = options.prefixes, prefixes = _a === void 0 ? "./" : _a; + var defaultPattern = "[^" + escapeString(options.delimiter || "/#?") + "]+?"; + var result = []; + var key = 0; + var i = 0; + var path = ""; + var tryConsume = function (type) { + if (i < tokens.length && tokens[i].type === type) + return tokens[i++].value; + }; + var mustConsume = function (type) { + var value = tryConsume(type); + if (value !== undefined) + return value; + var _a = tokens[i], nextType = _a.type, index = _a.index; + throw new TypeError("Unexpected " + nextType + " at " + index + ", expected " + type); + }; + var consumeText = function () { + var result = ""; + var value; + // tslint:disable-next-line + while ((value = tryConsume("CHAR") || tryConsume("ESCAPED_CHAR"))) { + result += value; + } + return result; + }; + while (i < tokens.length) { + var char = tryConsume("CHAR"); + var name = tryConsume("NAME"); + var pattern = tryConsume("PATTERN"); + if (name || pattern) { + var prefix = char || ""; + if (prefixes.indexOf(prefix) === -1) { + path += prefix; + prefix = ""; + } + if (path) { + result.push(path); + path = ""; + } + result.push({ + name: name || key++, + prefix: prefix, + suffix: "", + pattern: pattern || defaultPattern, + modifier: tryConsume("MODIFIER") || "" + }); + continue; + } + var value = char || tryConsume("ESCAPED_CHAR"); + if (value) { + path += value; + continue; + } + if (path) { + result.push(path); + path = ""; + } + var open = tryConsume("OPEN"); + if (open) { + var prefix = consumeText(); + var name_1 = tryConsume("NAME") || ""; + var pattern_1 = tryConsume("PATTERN") || ""; + var suffix = consumeText(); + mustConsume("CLOSE"); + result.push({ + name: name_1 || (pattern_1 ? key++ : ""), + pattern: name_1 && !pattern_1 ? defaultPattern : pattern_1, + prefix: prefix, + suffix: suffix, + modifier: tryConsume("MODIFIER") || "" + }); + continue; + } + mustConsume("END"); + } + return result; +} +exports.parse = parse; +/** + * Compile a string to a template function for the path. + */ +function compile(str, options) { + return tokensToFunction(parse(str, options), options); +} +exports.compile = compile; +/** + * Expose a method for transforming tokens into the path function. + */ +function tokensToFunction(tokens, options) { + if (options === void 0) { options = {}; } + var reFlags = flags(options); + var _a = options.encode, encode = _a === void 0 ? function (x) { return x; } : _a, _b = options.validate, validate = _b === void 0 ? true : _b; + // Compile all the tokens into regexps. + var matches = tokens.map(function (token) { + if (typeof token === "object") { + return new RegExp("^(?:" + token.pattern + ")$", reFlags); + } + }); + return function (data) { + var path = ""; + for (var i = 0; i < tokens.length; i++) { + var token = tokens[i]; + if (typeof token === "string") { + path += token; + continue; + } + var value = data ? data[token.name] : undefined; + var optional = token.modifier === "?" || token.modifier === "*"; + var repeat = token.modifier === "*" || token.modifier === "+"; + if (Array.isArray(value)) { + if (!repeat) { + throw new TypeError("Expected \"" + token.name + "\" to not repeat, but got an array"); + } + if (value.length === 0) { + if (optional) + continue; + throw new TypeError("Expected \"" + token.name + "\" to not be empty"); + } + for (var j = 0; j < value.length; j++) { + var segment = encode(value[j], token); + if (validate && !matches[i].test(segment)) { + throw new TypeError("Expected all \"" + token.name + "\" to match \"" + token.pattern + "\", but got \"" + segment + "\""); + } + path += token.prefix + segment + token.suffix; + } + continue; + } + if (typeof value === "string" || typeof value === "number") { + var segment = encode(String(value), token); + if (validate && !matches[i].test(segment)) { + throw new TypeError("Expected \"" + token.name + "\" to match \"" + token.pattern + "\", but got \"" + segment + "\""); + } + path += token.prefix + segment + token.suffix; + continue; + } + if (optional) + continue; + var typeOfMessage = repeat ? "an array" : "a string"; + throw new TypeError("Expected \"" + token.name + "\" to be " + typeOfMessage); + } + return path; + }; +} +exports.tokensToFunction = tokensToFunction; +/** + * Create path match function from `path-to-regexp` spec. + */ +function match(str, options) { + var keys = []; + var re = pathToRegexp(str, keys, options); + return regexpToFunction(re, keys, options); +} +exports.match = match; +/** + * Create a path match function from `path-to-regexp` output. + */ +function regexpToFunction(re, keys, options) { + if (options === void 0) { options = {}; } + var _a = options.decode, decode = _a === void 0 ? function (x) { return x; } : _a; + return function (pathname) { + var m = re.exec(pathname); + if (!m) + return false; + var path = m[0], index = m.index; + var params = Object.create(null); + var _loop_1 = function (i) { + // tslint:disable-next-line + if (m[i] === undefined) + return "continue"; + var key = keys[i - 1]; + if (key.modifier === "*" || key.modifier === "+") { + params[key.name] = m[i].split(key.prefix + key.suffix).map(function (value) { + return decode(value, key); + }); + } + else { + params[key.name] = decode(m[i], key); + } + }; + for (var i = 1; i < m.length; i++) { + _loop_1(i); + } + return { path: path, index: index, params: params }; + }; +} +exports.regexpToFunction = regexpToFunction; +/** + * Escape a regular expression string. + */ +function escapeString(str) { + return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1"); +} +/** + * Get the flags for a regexp from the options. + */ +function flags(options) { + return options && options.sensitive ? "" : "i"; +} +/** + * Pull out keys from a regexp. + */ +function regexpToRegexp(path, keys) { + if (!keys) + return path; + // Use a negative lookahead to match only capturing groups. + var groups = path.source.match(/\((?!\?)/g); + if (groups) { + for (var i = 0; i < groups.length; i++) { + keys.push({ + name: i, + prefix: "", + suffix: "", + modifier: "", + pattern: "" + }); + } + } + return path; +} +/** + * Transform an array into a regexp. + */ +function arrayToRegexp(paths, keys, options) { + var parts = paths.map(function (path) { return pathToRegexp(path, keys, options).source; }); + return new RegExp("(?:" + parts.join("|") + ")", flags(options)); +} +/** + * Create a path regexp from string input. + */ +function stringToRegexp(path, keys, options) { + return tokensToRegexp(parse(path, options), keys, options); +} +/** + * Expose a function for taking tokens and returning a RegExp. + */ +function tokensToRegexp(tokens, keys, options) { + if (options === void 0) { options = {}; } + var _a = options.strict, strict = _a === void 0 ? false : _a, _b = options.start, start = _b === void 0 ? true : _b, _c = options.end, end = _c === void 0 ? true : _c, _d = options.encode, encode = _d === void 0 ? function (x) { return x; } : _d; + var endsWith = "[" + escapeString(options.endsWith || "") + "]|$"; + var delimiter = "[" + escapeString(options.delimiter || "/#?") + "]"; + var route = start ? "^" : ""; + // Iterate over the tokens and create our regexp string. + for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) { + var token = tokens_1[_i]; + if (typeof token === "string") { + route += escapeString(encode(token)); + } + else { + var prefix = escapeString(encode(token.prefix)); + var suffix = escapeString(encode(token.suffix)); + if (token.pattern) { + if (keys) + keys.push(token); + if (prefix || suffix) { + if (token.modifier === "+" || token.modifier === "*") { + var mod = token.modifier === "*" ? "?" : ""; + route += "(?:" + prefix + "((?:" + token.pattern + ")(?:" + suffix + prefix + "(?:" + token.pattern + "))*)" + suffix + ")" + mod; + } + else { + route += "(?:" + prefix + "(" + token.pattern + ")" + suffix + ")" + token.modifier; + } + } + else { + route += "(" + token.pattern + ")" + token.modifier; + } + } + else { + route += "(?:" + prefix + suffix + ")" + token.modifier; + } + } + } + if (end) { + if (!strict) + route += delimiter + "?"; + route += !options.endsWith ? "$" : "(?=" + endsWith + ")"; + } + else { + var endToken = tokens[tokens.length - 1]; + var isEndDelimited = typeof endToken === "string" + ? delimiter.indexOf(endToken[endToken.length - 1]) > -1 + : // tslint:disable-next-line + endToken === undefined; + if (!strict) { + route += "(?:" + delimiter + "(?=" + endsWith + "))?"; + } + if (!isEndDelimited) { + route += "(?=" + delimiter + "|" + endsWith + ")"; + } + } + return new RegExp(route, flags(options)); +} +exports.tokensToRegexp = tokensToRegexp; +/** + * Normalize the given path string, returning a regular expression. + * + * An empty array can be passed in for the keys, which will hold the + * placeholder key descriptions. For example, using `/user/:id`, `keys` will + * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. + */ +function pathToRegexp(path, keys, options) { + if (path instanceof RegExp) + return regexpToRegexp(path, keys); + if (Array.isArray(path)) + return arrayToRegexp(path, keys, options); + return stringToRegexp(path, keys, options); +} +exports.pathToRegexp = pathToRegexp; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/next/src/compiled/path-to-regexp/index.js.map b/packages/next/src/compiled/path-to-regexp/index.js.map new file mode 100644 index 0000000000000..d5f148ed3ed9c --- /dev/null +++ b/packages/next/src/compiled/path-to-regexp/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAiBA;;GAEG;AACH,SAAS,KAAK,CAAC,GAAW;IACxB,IAAM,MAAM,GAAe,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE;QACrB,IAAM,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;QAEpB,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,GAAG,EAAE;YAChD,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YAC7D,SAAS;SACV;QAED,IAAI,IAAI,KAAK,IAAI,EAAE;YACjB,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACnE,SAAS;SACV;QAED,IAAI,I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C,GAAG,CAAC,CAAC;YACvD,CAAC,CAAC,2BAA2B;gBAC3B,QAAQ,KAAK,SAAS,CAAC;QAE7B,IAAI,CAAC,MAAM,EAAE;YACX,KAAK,IAAI,QAAM,SAAS,WAAM,QAAQ,QAAK,CAAC;SAC7C;QAED,IAAI,CAAC,cAAc,EAAE;YACnB,KAAK,IAAI,QAAM,SAAS,SAAI,QAAQ,MAAG,CAAC;SACzC;KACF;IAED,OAAO,IAAI,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3C,CAAC;AAhED,wCAgEC;AAOD;;;;;;GAMG;AACH,SAAgB,YAAY,CAC1B,IAAU,EACV,IAAY,EACZ,OAA8C;IAE9C,IAAI,IAAI,YAAY,MAAM;QAAE,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9D,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACnE,OAAO,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7C,CAAC;AARD,oCAQC","sourcesContent":["/**\n * Tokenizer results.\n */\ninterface LexToken {\n type:\n | \"OPEN\"\n | \"CLOSE\"\n | \"PATTERN\"\n | \"NAME\"\n | \"CHAR\"\n | \"ESCAPED_CHAR\"\n | \"MODIFIER\"\n | \"END\";\n index: number;\n value: string;\n}\n\n/**\n * Tokenize input string.\n */\nfunction lexer(str: string): LexToken[] {\n const tokens: LexToken[] = [];\n let i = 0;\n\n while (i < str.length) {\n const char = str[i];\n\n if (char === \"*\" || char === \"+\" || char === \"?\") {\n tokens.push({ type: \"MODIFIER\", index: i, value: str[i++] });\n continue;\n }\n\n if (char === \"\\\\\") {\n tokens.push({ type: \"ESCAPED_CHAR\", index: i++, value: str[i++] });\n continue;\n }\n\n if (char === \"{\") {\n tokens.push({ type: \"OPEN\", index: i, value: str[i++] });\n continue;\n }\n\n if (char === \"}\") {\n tokens.push({ type: \"CLOSE\", index: i, value: str[i++] });\n continue;\n }\n\n if (char === \":\") {\n let name = \"\";\n let j = i + 1;\n\n while (j < str.length) {\n const code = str.charCodeAt(j);\n\n if (\n // `0-9`\n (code >= 48 && code <= 57) ||\n // `A-Z`\n (code >= 65 && code <= 90) ||\n // `a-z`\n (code >= 97 && code <= 122) ||\n // `_`\n code === 95\n ) {\n name += str[j++];\n continue;\n }\n\n break;\n }\n\n if (!name) throw new TypeError(`Missing parameter name at ${i}`);\n\n tokens.push({ type: \"NAME\", index: i, value: name });\n i = j;\n continue;\n }\n\n if (char === \"(\") {\n let count = 1;\n let pattern = \"\";\n let j = i + 1;\n\n if (str[j] === \"?\") {\n throw new TypeError(`Pattern cannot start with \"?\" at ${j}`);\n }\n\n while (j < str.length) {\n if (str[j] === \"\\\\\") {\n pattern += str[j++] + str[j++];\n continue;\n }\n\n if (str[j] === \")\") {\n count--;\n if (count === 0) {\n j++;\n break;\n }\n } else if (str[j] === \"(\") {\n count++;\n if (str[j + 1] !== \"?\") {\n throw new TypeError(`Capturing groups are not allowed at ${j}`);\n }\n }\n\n pattern += str[j++];\n }\n\n if (count) throw new TypeError(`Unbalanced pattern at ${i}`);\n if (!pattern) throw new TypeError(`Missing pattern at ${i}`);\n\n tokens.push({ type: \"PATTERN\", index: i, value: pattern });\n i = j;\n continue;\n }\n\n tokens.push({ type: \"CHAR\", index: i, value: str[i++] });\n }\n\n tokens.push({ type: \"END\", index: i, value: \"\" });\n\n return tokens;\n}\n\nexport interface ParseOptions {\n /**\n * Set the default delimiter for repeat parameters. (default: `'/'`)\n */\n delimiter?: string;\n /**\n * List of characters to automatically consider prefixes when parsing.\n */\n prefixes?: string;\n}\n\n/**\n * Parse a string for the raw tokens.\n */\nexport function parse(str: string, options: ParseOptions = {}): Token[] {\n const tokens = lexer(str);\n const { prefixes = \"./\" } = options;\n const defaultPattern = `[^${escapeString(options.delimiter || \"/#?\")}]+?`;\n const result: Token[] = [];\n let key = 0;\n let i = 0;\n let path = \"\";\n\n const tryConsume = (type: LexToken[\"type\"]): string | undefined => {\n if (i < tokens.length && tokens[i].type === type) return tokens[i++].value;\n };\n\n const mustConsume = (type: LexToken[\"type\"]): string => {\n const value = tryConsume(type);\n if (value !== undefined) return value;\n const { type: nextType, index } = tokens[i];\n throw new TypeError(`Unexpected ${nextType} at ${index}, expected ${type}`);\n };\n\n const consumeText = (): string => {\n let result = \"\";\n let value: string | undefined;\n // tslint:disable-next-line\n while ((value = tryConsume(\"CHAR\") || tryConsume(\"ESCAPED_CHAR\"))) {\n result += value;\n }\n return result;\n };\n\n while (i < tokens.length) {\n const char = tryConsume(\"CHAR\");\n const name = tryConsume(\"NAME\");\n const pattern = tryConsume(\"PATTERN\");\n\n if (name || pattern) {\n let prefix = char || \"\";\n\n if (prefixes.indexOf(prefix) === -1) {\n path += prefix;\n prefix = \"\";\n }\n\n if (path) {\n result.push(path);\n path = \"\";\n }\n\n result.push({\n name: name || key++,\n prefix,\n suffix: \"\",\n pattern: pattern || defaultPattern,\n modifier: tryConsume(\"MODIFIER\") || \"\"\n });\n continue;\n }\n\n const value = char || tryConsume(\"ESCAPED_CHAR\");\n if (value) {\n path += value;\n continue;\n }\n\n if (path) {\n result.push(path);\n path = \"\";\n }\n\n const open = tryConsume(\"OPEN\");\n if (open) {\n const prefix = consumeText();\n const name = tryConsume(\"NAME\") || \"\";\n const pattern = tryConsume(\"PATTERN\") || \"\";\n const suffix = consumeText();\n\n mustConsume(\"CLOSE\");\n\n result.push({\n name: name || (pattern ? key++ : \"\"),\n pattern: name && !pattern ? defaultPattern : pattern,\n prefix,\n suffix,\n modifier: tryConsume(\"MODIFIER\") || \"\"\n });\n continue;\n }\n\n mustConsume(\"END\");\n }\n\n return result;\n}\n\nexport interface TokensToFunctionOptions {\n /**\n * When `true` the regexp will be case sensitive. (default: `false`)\n */\n sensitive?: boolean;\n /**\n * Function for encoding input strings for output.\n */\n encode?: (value: string, token: Key) => string;\n /**\n * When `false` the function can produce an invalid (unmatched) path. (default: `true`)\n */\n validate?: boolean;\n}\n\n/**\n * Compile a string to a template function for the path.\n */\nexport function compile

(\n str: string,\n options?: ParseOptions & TokensToFunctionOptions\n) {\n return tokensToFunction

(parse(str, options), options);\n}\n\nexport type PathFunction

= (data?: P) => string;\n\n/**\n * Expose a method for transforming tokens into the path function.\n */\nexport function tokensToFunction

(\n tokens: Token[],\n options: TokensToFunctionOptions = {}\n): PathFunction

{\n const reFlags = flags(options);\n const { encode = (x: string) => x, validate = true } = options;\n\n // Compile all the tokens into regexps.\n const matches = tokens.map(token => {\n if (typeof token === \"object\") {\n return new RegExp(`^(?:${token.pattern})$`, reFlags);\n }\n });\n\n return (data: Record | null | undefined) => {\n let path = \"\";\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n if (typeof token === \"string\") {\n path += token;\n continue;\n }\n\n const value = data ? data[token.name] : undefined;\n const optional = token.modifier === \"?\" || token.modifier === \"*\";\n const repeat = token.modifier === \"*\" || token.modifier === \"+\";\n\n if (Array.isArray(value)) {\n if (!repeat) {\n throw new TypeError(\n `Expected \"${token.name}\" to not repeat, but got an array`\n );\n }\n\n if (value.length === 0) {\n if (optional) continue;\n\n throw new TypeError(`Expected \"${token.name}\" to not be empty`);\n }\n\n for (let j = 0; j < value.length; j++) {\n const segment = encode(value[j], token);\n\n if (validate && !(matches[i] as RegExp).test(segment)) {\n throw new TypeError(\n `Expected all \"${token.name}\" to match \"${token.pattern}\", but got \"${segment}\"`\n );\n }\n\n path += token.prefix + segment + token.suffix;\n }\n\n continue;\n }\n\n if (typeof value === \"string\" || typeof value === \"number\") {\n const segment = encode(String(value), token);\n\n if (validate && !(matches[i] as RegExp).test(segment)) {\n throw new TypeError(\n `Expected \"${token.name}\" to match \"${token.pattern}\", but got \"${segment}\"`\n );\n }\n\n path += token.prefix + segment + token.suffix;\n continue;\n }\n\n if (optional) continue;\n\n const typeOfMessage = repeat ? \"an array\" : \"a string\";\n throw new TypeError(`Expected \"${token.name}\" to be ${typeOfMessage}`);\n }\n\n return path;\n };\n}\n\nexport interface RegexpToFunctionOptions {\n /**\n * Function for decoding strings for params.\n */\n decode?: (value: string, token: Key) => string;\n}\n\n/**\n * A match result contains data about the path match.\n */\nexport interface MatchResult

{\n path: string;\n index: number;\n params: P;\n}\n\n/**\n * A match is either `false` (no match) or a match result.\n */\nexport type Match

= false | MatchResult

;\n\n/**\n * The match function takes a string and returns whether it matched the path.\n */\nexport type MatchFunction

= (\n path: string\n) => Match

;\n\n/**\n * Create path match function from `path-to-regexp` spec.\n */\nexport function match

(\n str: Path,\n options?: ParseOptions & TokensToRegexpOptions & RegexpToFunctionOptions\n) {\n const keys: Key[] = [];\n const re = pathToRegexp(str, keys, options);\n return regexpToFunction

(re, keys, options);\n}\n\n/**\n * Create a path match function from `path-to-regexp` output.\n */\nexport function regexpToFunction

(\n re: RegExp,\n keys: Key[],\n options: RegexpToFunctionOptions = {}\n): MatchFunction

{\n const { decode = (x: string) => x } = options;\n\n return function(pathname: string) {\n const m = re.exec(pathname);\n if (!m) return false;\n\n const { 0: path, index } = m;\n const params = Object.create(null);\n\n for (let i = 1; i < m.length; i++) {\n // tslint:disable-next-line\n if (m[i] === undefined) continue;\n\n const key = keys[i - 1];\n\n if (key.modifier === \"*\" || key.modifier === \"+\") {\n params[key.name] = m[i].split(key.prefix + key.suffix).map(value => {\n return decode(value, key);\n });\n } else {\n params[key.name] = decode(m[i], key);\n }\n }\n\n return { path, index, params };\n };\n}\n\n/**\n * Escape a regular expression string.\n */\nfunction escapeString(str: string) {\n return str.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n}\n\n/**\n * Get the flags for a regexp from the options.\n */\nfunction flags(options?: { sensitive?: boolean }) {\n return options && options.sensitive ? \"\" : \"i\";\n}\n\n/**\n * Metadata about a key.\n */\nexport interface Key {\n name: string | number;\n prefix: string;\n suffix: string;\n pattern: string;\n modifier: string;\n}\n\n/**\n * A token is a string (nothing special) or key metadata (capture group).\n */\nexport type Token = string | Key;\n\n/**\n * Pull out keys from a regexp.\n */\nfunction regexpToRegexp(path: RegExp, keys?: Key[]): RegExp {\n if (!keys) return path;\n\n // Use a negative lookahead to match only capturing groups.\n const groups = path.source.match(/\\((?!\\?)/g);\n\n if (groups) {\n for (let i = 0; i < groups.length; i++) {\n keys.push({\n name: i,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\"\n });\n }\n }\n\n return path;\n}\n\n/**\n * Transform an array into a regexp.\n */\nfunction arrayToRegexp(\n paths: Array,\n keys?: Key[],\n options?: TokensToRegexpOptions & ParseOptions\n): RegExp {\n const parts = paths.map(path => pathToRegexp(path, keys, options).source);\n return new RegExp(`(?:${parts.join(\"|\")})`, flags(options));\n}\n\n/**\n * Create a path regexp from string input.\n */\nfunction stringToRegexp(\n path: string,\n keys?: Key[],\n options?: TokensToRegexpOptions & ParseOptions\n) {\n return tokensToRegexp(parse(path, options), keys, options);\n}\n\nexport interface TokensToRegexpOptions {\n /**\n * When `true` the regexp will be case sensitive. (default: `false`)\n */\n sensitive?: boolean;\n /**\n * When `true` the regexp allows an optional trailing delimiter to match. (default: `false`)\n */\n strict?: boolean;\n /**\n * When `true` the regexp will match to the end of the string. (default: `true`)\n */\n end?: boolean;\n /**\n * When `true` the regexp will match from the beginning of the string. (default: `true`)\n */\n start?: boolean;\n /**\n * Sets the final character for non-ending optimistic matches. (default: `/`)\n */\n delimiter?: string;\n /**\n * List of characters that can also be \"end\" characters.\n */\n endsWith?: string;\n /**\n * Encode path tokens for use in the `RegExp`.\n */\n encode?: (value: string) => string;\n}\n\n/**\n * Expose a function for taking tokens and returning a RegExp.\n */\nexport function tokensToRegexp(\n tokens: Token[],\n keys?: Key[],\n options: TokensToRegexpOptions = {}\n) {\n const {\n strict = false,\n start = true,\n end = true,\n encode = (x: string) => x\n } = options;\n const endsWith = `[${escapeString(options.endsWith || \"\")}]|$`;\n const delimiter = `[${escapeString(options.delimiter || \"/#?\")}]`;\n let route = start ? \"^\" : \"\";\n\n // Iterate over the tokens and create our regexp string.\n for (const token of tokens) {\n if (typeof token === \"string\") {\n route += escapeString(encode(token));\n } else {\n const prefix = escapeString(encode(token.prefix));\n const suffix = escapeString(encode(token.suffix));\n\n if (token.pattern) {\n if (keys) keys.push(token);\n\n if (prefix || suffix) {\n if (token.modifier === \"+\" || token.modifier === \"*\") {\n const mod = token.modifier === \"*\" ? \"?\" : \"\";\n route += `(?:${prefix}((?:${token.pattern})(?:${suffix}${prefix}(?:${token.pattern}))*)${suffix})${mod}`;\n } else {\n route += `(?:${prefix}(${token.pattern})${suffix})${token.modifier}`;\n }\n } else {\n route += `(${token.pattern})${token.modifier}`;\n }\n } else {\n route += `(?:${prefix}${suffix})${token.modifier}`;\n }\n }\n }\n\n if (end) {\n if (!strict) route += `${delimiter}?`;\n\n route += !options.endsWith ? \"$\" : `(?=${endsWith})`;\n } else {\n const endToken = tokens[tokens.length - 1];\n const isEndDelimited =\n typeof endToken === \"string\"\n ? delimiter.indexOf(endToken[endToken.length - 1]) > -1\n : // tslint:disable-next-line\n endToken === undefined;\n\n if (!strict) {\n route += `(?:${delimiter}(?=${endsWith}))?`;\n }\n\n if (!isEndDelimited) {\n route += `(?=${delimiter}|${endsWith})`;\n }\n }\n\n return new RegExp(route, flags(options));\n}\n\n/**\n * Supported `path-to-regexp` input types.\n */\nexport type Path = string | RegExp | Array;\n\n/**\n * Normalize the given path string, returning a regular expression.\n *\n * An empty array can be passed in for the keys, which will hold the\n * placeholder key descriptions. For example, using `/user/:id`, `keys` will\n * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.\n */\nexport function pathToRegexp(\n path: Path,\n keys?: Key[],\n options?: TokensToRegexpOptions & ParseOptions\n) {\n if (path instanceof RegExp) return regexpToRegexp(path, keys);\n if (Array.isArray(path)) return arrayToRegexp(path, keys, options);\n return stringToRegexp(path, keys, options);\n}\n"]} \ No newline at end of file diff --git a/packages/next/src/compiled/path-to-regexp/index.spec.js b/packages/next/src/compiled/path-to-regexp/index.spec.js new file mode 100644 index 0000000000000..698c2d6e62558 --- /dev/null +++ b/packages/next/src/compiled/path-to-regexp/index.spec.js @@ -0,0 +1,2737 @@ +"use strict"; +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var util = require("util"); +var pathToRegexp = require("./index"); +/** + * An array of test cases with expected inputs and outputs. + */ +var TESTS = [ + /** + * Simple paths. + */ + [ + "/", + undefined, + ["/"], + [ + ["/", ["/"], { path: "/", index: 0, params: {} }], + ["/route", null, false] + ], + [ + [null, "/"], + [{}, "/"], + [{ id: 123 }, "/"] + ] + ], + [ + "/test", + undefined, + ["/test"], + [ + ["/test", ["/test"], { path: "/test", index: 0, params: {} }], + ["/route", null, false], + ["/test/route", null, false], + ["/test/", ["/test/"], { path: "/test/", index: 0, params: {} }] + ], + [ + [null, "/test"], + [{}, "/test"] + ] + ], + [ + "/test/", + undefined, + ["/test/"], + [ + ["/test", null], + ["/test/", ["/test/"]], + ["/test//", ["/test//"]] + ], + [[null, "/test/"]] + ], + /** + * Case-sensitive paths. + */ + [ + "/test", + { + sensitive: true + }, + ["/test"], + [ + ["/test", ["/test"]], + ["/TEST", null] + ], + [[null, "/test"]] + ], + [ + "/TEST", + { + sensitive: true + }, + ["/TEST"], + [ + ["/test", null], + ["/TEST", ["/TEST"]] + ], + [[null, "/TEST"]] + ], + /** + * Strict mode. + */ + [ + "/test", + { + strict: true + }, + ["/test"], + [ + ["/test", ["/test"]], + ["/test/", null], + ["/TEST", ["/TEST"]] + ], + [[null, "/test"]] + ], + [ + "/test/", + { + strict: true + }, + ["/test/"], + [ + ["/test", null], + ["/test/", ["/test/"]], + ["/test//", null] + ], + [[null, "/test/"]] + ], + /** + * Non-ending mode. + */ + [ + "/test", + { + end: false + }, + ["/test"], + [ + ["/test", ["/test"]], + ["/test/", ["/test/"]], + ["/test/route", ["/test"]], + ["/route", null] + ], + [[null, "/test"]] + ], + [ + "/test/", + { + end: false + }, + ["/test/"], + [ + ["/test", null], + ["/test/route", ["/test/"]], + ["/test//", ["/test//"]], + ["/test//route", ["/test/"]] + ], + [[null, "/test/"]] + ], + [ + "/:test", + { + end: false + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + [ + "/route", + ["/route", "route"], + { path: "/route", index: 0, params: { test: "route" } } + ], + [ + "/caf%C3%A9", + ["/caf%C3%A9", "caf%C3%A9"], + { path: "/caf%C3%A9", index: 0, params: { test: "caf%C3%A9" } } + ], + [ + "/caf%C3%A9", + ["/caf%C3%A9", "caf%C3%A9"], + { path: "/caf%C3%A9", index: 0, params: { test: "café" } }, + { decode: decodeURIComponent } + ] + ], + [ + [{}, null], + [{ test: "abc" }, "/abc"], + [{ test: "a+b" }, "/a+b"], + [{ test: "a+b" }, "/test", { encode: function (_, token) { return String(token.name); } }], + [{ test: "a+b" }, "/a%2Bb", { encode: encodeURIComponent }] + ] + ], + [ + "/:test/", + { + end: false + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + "/" + ], + [ + ["/route", null], + ["/route/", ["/route/", "route"]] + ], + [[{ test: "abc" }, "/abc/"]] + ], + [ + "", + { + end: false + }, + [], + [ + ["", [""]], + ["/", ["/"]], + ["route", [""]], + ["/route", [""]], + ["/route/", [""]] + ], + [[null, ""]] + ], + /** + * Non-starting mode. + */ + [ + "/test", + { + start: false + }, + ["/test"], + [ + ["/test", ["/test"]], + ["/test/", ["/test/"]], + ["/route/test", ["/test"]], + ["/test/route", null], + ["/route/test/deep", null], + ["/route", null] + ], + [[null, "/test"]] + ], + [ + "/test/", + { + start: false + }, + ["/test/"], + [ + ["/test", null], + ["/test/route", null], + ["/test//route", null], + ["/test//", ["/test//"]], + ["/route/test/", ["/test/"]] + ], + [[null, "/test/"]] + ], + [ + "/:test", + { + start: false + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [["/route", ["/route", "route"]]], + [ + [{}, null], + [{ test: "abc" }, "/abc"], + [{ test: "a+b" }, "/a+b"], + [{ test: "a+b" }, "/test", { encode: function (_, token) { return String(token.name); } }], + [{ test: "a+b" }, "/a%2Bb", { encode: encodeURIComponent }] + ] + ], + [ + "/:test/", + { + start: false + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + "/" + ], + [ + ["/route", null], + ["/route/", ["/route/", "route"]] + ], + [[{ test: "abc" }, "/abc/"]] + ], + [ + "", + { + start: false + }, + [], + [ + ["", [""]], + ["/", ["/"]], + ["route", [""]], + ["/route", [""]], + ["/route/", ["/"]] + ], + [[null, ""]] + ], + /** + * Combine modes. + */ + [ + "/test", + { + end: false, + strict: true + }, + ["/test"], + [ + ["/test", ["/test"]], + ["/test/", ["/test"]], + ["/test/route", ["/test"]] + ], + [[null, "/test"]] + ], + [ + "/test/", + { + end: false, + strict: true + }, + ["/test/"], + [ + ["/test", null], + ["/test/", ["/test/"]], + ["/test//", ["/test/"]], + ["/test/route", ["/test/"]] + ], + [[null, "/test/"]] + ], + [ + "/test.json", + { + end: false, + strict: true + }, + ["/test.json"], + [ + ["/test.json", ["/test.json"]], + ["/test.json.hbs", null], + ["/test.json/route", ["/test.json"]] + ], + [[null, "/test.json"]] + ], + [ + "/:test", + { + end: false, + strict: true + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/route", ["/route", "route"]], + ["/route/", ["/route", "route"]] + ], + [ + [{}, null], + [{ test: "abc" }, "/abc"] + ] + ], + [ + "/:test/", + { + end: false, + strict: true + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + "/" + ], + [ + ["/route", null], + ["/route/", ["/route/", "route"]] + ], + [[{ test: "foobar" }, "/foobar/"]] + ], + [ + "/test", + { + start: false, + end: false + }, + ["/test"], + [ + ["/test", ["/test"]], + ["/test/", ["/test/"]], + ["/test/route", ["/test"]], + ["/route/test/deep", ["/test"]] + ], + [[null, "/test"]] + ], + [ + "/test/", + { + start: false, + end: false + }, + ["/test/"], + [ + ["/test", null], + ["/test/", ["/test/"]], + ["/test//", ["/test//"]], + ["/test/route", ["/test/"]], + ["/route/test/deep", ["/test/"]] + ], + [[null, "/test/"]] + ], + [ + "/test.json", + { + start: false, + end: false + }, + ["/test.json"], + [ + ["/test.json", ["/test.json"]], + ["/test.json.hbs", null], + ["/test.json/route", ["/test.json"]], + ["/route/test.json/deep", ["/test.json"]] + ], + [[null, "/test.json"]] + ], + [ + "/:test", + { + start: false, + end: false + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/route", ["/route", "route"]], + ["/route/", ["/route/", "route"]] + ], + [ + [{}, null], + [{ test: "abc" }, "/abc"] + ] + ], + [ + "/:test/", + { + end: false, + strict: true + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + "/" + ], + [ + ["/route", null], + ["/route/", ["/route/", "route"]] + ], + [[{ test: "foobar" }, "/foobar/"]] + ], + /** + * Arrays of simple paths. + */ + [ + ["/one", "/two"], + undefined, + [], + [ + ["/one", ["/one"]], + ["/two", ["/two"]], + ["/three", null], + ["/one/two", null] + ], + [] + ], + /** + * Non-ending simple path. + */ + [ + "/test", + { + end: false + }, + ["/test"], + [["/test/route", ["/test"]]], + [[null, "/test"]] + ], + /** + * Single named parameter. + */ + [ + "/:test", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/route", ["/route", "route"]], + ["/another", ["/another", "another"]], + ["/something/else", null], + ["/route.json", ["/route.json", "route.json"]], + ["/something%2Felse", ["/something%2Felse", "something%2Felse"]], + [ + "/something%2Felse%2Fmore", + ["/something%2Felse%2Fmore", "something%2Felse%2Fmore"] + ], + ["/;,:@&=+$-_.!~*()", ["/;,:@&=+$-_.!~*()", ";,:@&=+$-_.!~*()"]] + ], + [ + [{ test: "route" }, "/route"], + [ + { test: "something/else" }, + "/something%2Felse", + { encode: encodeURIComponent } + ], + [ + { test: "something/else/more" }, + "/something%2Felse%2Fmore", + { encode: encodeURIComponent } + ] + ] + ], + [ + "/:test", + { + strict: true + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/route", ["/route", "route"]], + ["/route/", null] + ], + [[{ test: "route" }, "/route"]] + ], + [ + "/:test/", + { + strict: true + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + "/" + ], + [ + ["/route/", ["/route/", "route"]], + ["/route//", null] + ], + [[{ test: "route" }, "/route/"]] + ], + [ + "/:test", + { + end: false + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/route.json", ["/route.json", "route.json"]], + ["/route//", ["/route", "route"]] + ], + [[{ test: "route" }, "/route"]] + ], + /** + * Optional named parameter. + */ + [ + "/:test?", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "?", + pattern: "[^\\/#\\?]+?" + } + ], + [ + [ + "/route", + ["/route", "route"], + { path: "/route", index: 0, params: { test: "route" } } + ], + ["/route/nested", null, false], + ["/", ["/", undefined], { path: "/", index: 0, params: {} }], + ["//", null] + ], + [ + [null, ""], + [{ test: "foobar" }, "/foobar"] + ] + ], + [ + "/:test?", + { + strict: true + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "?", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/route", ["/route", "route"]], + ["/", null], + ["//", null] + ], + [ + [null, ""], + [{ test: "foobar" }, "/foobar"] + ] + ], + [ + "/:test?/", + { + strict: true + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "?", + pattern: "[^\\/#\\?]+?" + }, + "/" + ], + [ + ["/route", null], + ["/route/", ["/route/", "route"]], + ["/", ["/", undefined]], + ["//", null] + ], + [ + [null, "/"], + [{ test: "foobar" }, "/foobar/"] + ] + ], + [ + "/:test?/bar", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "?", + pattern: "[^\\/#\\?]+?" + }, + "/bar" + ], + [ + ["/bar", ["/bar", undefined]], + ["/foo/bar", ["/foo/bar", "foo"]] + ], + [ + [null, "/bar"], + [{ test: "foo" }, "/foo/bar"] + ] + ], + [ + "/:test?-bar", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "?", + pattern: "[^\\/#\\?]+?" + }, + "-bar" + ], + [ + ["-bar", ["-bar", undefined]], + ["/-bar", null], + ["/foo-bar", ["/foo-bar", "foo"]] + ], + [ + [undefined, "-bar"], + [{ test: "foo" }, "/foo-bar"] + ] + ], + [ + "/:test*-bar", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "*", + pattern: "[^\\/#\\?]+?" + }, + "-bar" + ], + [ + ["-bar", ["-bar", undefined]], + ["/-bar", null], + ["/foo-bar", ["/foo-bar", "foo"]], + ["/foo/baz-bar", ["/foo/baz-bar", "foo/baz"]] + ], + [[{ test: "foo" }, "/foo-bar"]] + ], + /** + * Repeated one or more times parameters. + */ + [ + "/:test+", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "+", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/", null, false], + [ + "/route", + ["/route", "route"], + { path: "/route", index: 0, params: { test: ["route"] } } + ], + [ + "/some/basic/route", + ["/some/basic/route", "some/basic/route"], + { + path: "/some/basic/route", + index: 0, + params: { test: ["some", "basic", "route"] } + } + ], + ["//", null, false] + ], + [ + [{}, null], + [{ test: "foobar" }, "/foobar"], + [{ test: ["a", "b", "c"] }, "/a/b/c"] + ] + ], + [ + "/:test(\\d+)+", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "+", + pattern: "\\d+" + } + ], + [ + ["/abc/456/789", null], + ["/123/456/789", ["/123/456/789", "123/456/789"]] + ], + [ + [{ test: "abc" }, null], + [{ test: 123 }, "/123"], + [{ test: [1, 2, 3] }, "/1/2/3"] + ] + ], + [ + "/route.:ext(json|xml)+", + undefined, + [ + "/route", + { + name: "ext", + prefix: ".", + suffix: "", + modifier: "+", + pattern: "json|xml" + } + ], + [ + ["/route", null], + ["/route.json", ["/route.json", "json"]], + ["/route.xml.json", ["/route.xml.json", "xml.json"]], + ["/route.html", null] + ], + [ + [{ ext: "foobar" }, null], + [{ ext: "xml" }, "/route.xml"], + [{ ext: ["xml", "json"] }, "/route.xml.json"] + ] + ], + [ + "/route.:ext(\\w+)/test", + undefined, + [ + "/route", + { + name: "ext", + prefix: ".", + suffix: "", + modifier: "", + pattern: "\\w+" + }, + "/test" + ], + [ + ["/route", null], + ["/route.json", null], + ["/route.xml/test", ["/route.xml/test", "xml"]], + ["/route.json.gz/test", null] + ], + [[{ ext: "xml" }, "/route.xml/test"]] + ], + /** + * Repeated zero or more times parameters. + */ + [ + "/:test*", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "*", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/", ["/", undefined], { path: "/", index: 0, params: {} }], + ["//", null, false], + [ + "/route", + ["/route", "route"], + { path: "/route", index: 0, params: { test: ["route"] } } + ], + [ + "/some/basic/route", + ["/some/basic/route", "some/basic/route"], + { + path: "/some/basic/route", + index: 0, + params: { test: ["some", "basic", "route"] } + } + ] + ], + [ + [{}, ""], + [{ test: [] }, ""], + [{ test: "foobar" }, "/foobar"], + [{ test: ["foo", "bar"] }, "/foo/bar"] + ] + ], + [ + "/route.:ext([a-z]+)*", + undefined, + [ + "/route", + { + name: "ext", + prefix: ".", + suffix: "", + modifier: "*", + pattern: "[a-z]+" + } + ], + [ + ["/route", ["/route", undefined]], + ["/route.json", ["/route.json", "json"]], + ["/route.json.xml", ["/route.json.xml", "json.xml"]], + ["/route.123", null] + ], + [ + [{}, "/route"], + [{ ext: [] }, "/route"], + [{ ext: "123" }, null], + [{ ext: "foobar" }, "/route.foobar"], + [{ ext: ["foo", "bar"] }, "/route.foo.bar"] + ] + ], + /** + * Custom named parameters. + */ + [ + "/:test(\\d+)", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "\\d+" + } + ], + [ + ["/123", ["/123", "123"]], + ["/abc", null], + ["/123/abc", null] + ], + [ + [{ test: "abc" }, null], + [{ test: "abc" }, "/abc", { validate: false }], + [{ test: "123" }, "/123"] + ] + ], + [ + "/:test(\\d+)", + { + end: false + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "\\d+" + } + ], + [ + ["/123", ["/123", "123"]], + ["/abc", null], + ["/123/abc", ["/123", "123"]] + ], + [[{ test: "123" }, "/123"]] + ], + [ + "/:test(.*)", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: ".*" + } + ], + [ + ["/anything/goes/here", ["/anything/goes/here", "anything/goes/here"]], + ["/;,:@&=/+$-_.!/~*()", ["/;,:@&=/+$-_.!/~*()", ";,:@&=/+$-_.!/~*()"]] + ], + [ + [{ test: "" }, "/"], + [{ test: "abc" }, "/abc"], + [{ test: "abc/123" }, "/abc%2F123", { encode: encodeURIComponent }], + [ + { test: "abc/123/456" }, + "/abc%2F123%2F456", + { encode: encodeURIComponent } + ] + ] + ], + [ + "/:route([a-z]+)", + undefined, + [ + { + name: "route", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[a-z]+" + } + ], + [ + ["/abcde", ["/abcde", "abcde"]], + ["/12345", null] + ], + [ + [{ route: "" }, null], + [{ route: "" }, "/", { validate: false }], + [{ route: "123" }, null], + [{ route: "123" }, "/123", { validate: false }], + [{ route: "abc" }, "/abc"] + ] + ], + [ + "/:route(this|that)", + undefined, + [ + { + name: "route", + prefix: "/", + suffix: "", + modifier: "", + pattern: "this|that" + } + ], + [ + ["/this", ["/this", "this"]], + ["/that", ["/that", "that"]], + ["/foo", null] + ], + [ + [{ route: "this" }, "/this"], + [{ route: "foo" }, null], + [{ route: "foo" }, "/foo", { validate: false }], + [{ route: "that" }, "/that"] + ] + ], + [ + "/:path(abc|xyz)*", + undefined, + [ + { + name: "path", + prefix: "/", + suffix: "", + modifier: "*", + pattern: "abc|xyz" + } + ], + [ + ["/abc", ["/abc", "abc"]], + ["/abc/abc", ["/abc/abc", "abc/abc"]], + ["/xyz/xyz", ["/xyz/xyz", "xyz/xyz"]], + ["/abc/xyz", ["/abc/xyz", "abc/xyz"]], + ["/abc/xyz/abc/xyz", ["/abc/xyz/abc/xyz", "abc/xyz/abc/xyz"]], + ["/xyzxyz", null] + ], + [ + [{ path: "abc" }, "/abc"], + [{ path: ["abc", "xyz"] }, "/abc/xyz"], + [{ path: ["xyz", "abc", "xyz"] }, "/xyz/abc/xyz"], + [{ path: "abc123" }, null], + [{ path: "abc123" }, "/abc123", { validate: false }], + [{ path: "abcxyz" }, null], + [{ path: "abcxyz" }, "/abcxyz", { validate: false }] + ] + ], + /** + * Prefixed slashes could be omitted. + */ + [ + "test", + undefined, + ["test"], + [ + ["test", ["test"]], + ["/test", null] + ], + [[null, "test"]] + ], + [ + ":test", + undefined, + [ + { + name: "test", + prefix: "", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["route", ["route", "route"]], + ["/route", null], + ["route/", ["route/", "route"]] + ], + [ + [{ test: "" }, null], + [{}, null], + [{ test: null }, null], + [{ test: "route" }, "route"] + ] + ], + [ + ":test", + { + strict: true + }, + [ + { + name: "test", + prefix: "", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["route", ["route", "route"]], + ["/route", null], + ["route/", null] + ], + [[{ test: "route" }, "route"]] + ], + [ + ":test", + { + end: false + }, + [ + { + name: "test", + prefix: "", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["route", ["route", "route"]], + ["/route", null], + ["route/", ["route/", "route"]], + ["route/foobar", ["route", "route"]] + ], + [[{ test: "route" }, "route"]] + ], + [ + ":test?", + undefined, + [ + { + name: "test", + prefix: "", + suffix: "", + modifier: "?", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["route", ["route", "route"]], + ["/route", null], + ["", ["", undefined]], + ["route/foobar", null] + ], + [ + [{}, ""], + [{ test: "" }, null], + [{ test: "route" }, "route"] + ] + ], + [ + "{:test/}+", + undefined, + [ + { + name: "test", + prefix: "", + suffix: "/", + modifier: "+", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["route/", ["route/", "route"]], + ["/route", null], + ["", null], + ["foo/bar/", ["foo/bar/", "foo/bar"]] + ], + [ + [{}, null], + [{ test: "" }, null], + [{ test: ["route"] }, "route/"], + [{ test: ["foo", "bar"] }, "foo/bar/"] + ] + ], + /** + * Formats. + */ + [ + "/test.json", + undefined, + ["/test.json"], + [ + ["/test.json", ["/test.json"]], + ["/route.json", null] + ], + [[{}, "/test.json"]] + ], + [ + "/:test.json", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + ".json" + ], + [ + ["/.json", null], + ["/test.json", ["/test.json", "test"]], + ["/route.json", ["/route.json", "route"]], + ["/route.json.json", ["/route.json.json", "route.json"]] + ], + [ + [{ test: "" }, null], + [{ test: "foo" }, "/foo.json"] + ] + ], + /** + * Format params. + */ + [ + "/test.:format(\\w+)", + undefined, + [ + "/test", + { + name: "format", + prefix: ".", + suffix: "", + modifier: "", + pattern: "\\w+" + } + ], + [ + ["/test.html", ["/test.html", "html"]], + ["/test.hbs.html", null] + ], + [ + [{}, null], + [{ format: "" }, null], + [{ format: "foo" }, "/test.foo"] + ] + ], + [ + "/test.:format(\\w+).:format(\\w+)", + undefined, + [ + "/test", + { + name: "format", + prefix: ".", + suffix: "", + modifier: "", + pattern: "\\w+" + }, + { + name: "format", + prefix: ".", + suffix: "", + modifier: "", + pattern: "\\w+" + } + ], + [ + ["/test.html", null], + ["/test.hbs.html", ["/test.hbs.html", "hbs", "html"]] + ], + [ + [{ format: "foo.bar" }, null], + [{ format: "foo" }, "/test.foo.foo"] + ] + ], + [ + "/test{.:format}+", + undefined, + [ + "/test", + { + name: "format", + prefix: ".", + suffix: "", + modifier: "+", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/test.html", ["/test.html", "html"]], + ["/test.hbs.html", ["/test.hbs.html", "hbs.html"]] + ], + [ + [{ format: [] }, null], + [{ format: "foo" }, "/test.foo"], + [{ format: ["foo", "bar"] }, "/test.foo.bar"] + ] + ], + [ + "/test.:format(\\w+)", + { + end: false + }, + [ + "/test", + { + name: "format", + prefix: ".", + suffix: "", + modifier: "", + pattern: "\\w+" + } + ], + [ + ["/test.html", ["/test.html", "html"]], + ["/test.hbs.html", null] + ], + [[{ format: "foo" }, "/test.foo"]] + ], + [ + "/test.:format.", + undefined, + [ + "/test", + { + name: "format", + prefix: ".", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + "." + ], + [ + ["/test.html.", ["/test.html.", "html"]], + ["/test.hbs.html", null] + ], + [ + [{ format: "" }, null], + [{ format: "foo" }, "/test.foo."] + ] + ], + /** + * Format and path params. + */ + [ + "/:test.:format", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + { + name: "format", + prefix: ".", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/route.html", ["/route.html", "route", "html"]], + ["/route", null], + ["/route.html.json", ["/route.html.json", "route", "html.json"]] + ], + [ + [{}, null], + [{ test: "route", format: "foo" }, "/route.foo"] + ] + ], + [ + "/:test{.:format}?", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + { + name: "format", + prefix: ".", + suffix: "", + modifier: "?", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/route", ["/route", "route", undefined]], + ["/route.json", ["/route.json", "route", "json"]], + ["/route.json.html", ["/route.json.html", "route", "json.html"]] + ], + [ + [{ test: "route" }, "/route"], + [{ test: "route", format: "" }, null], + [{ test: "route", format: "foo" }, "/route.foo"] + ] + ], + [ + "/:test.:format?", + { + end: false + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + { + name: "format", + prefix: ".", + suffix: "", + modifier: "?", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/route", ["/route", "route", undefined]], + ["/route.json", ["/route.json", "route", "json"]], + ["/route.json.html", ["/route.json.html", "route", "json.html"]] + ], + [ + [{ test: "route" }, "/route"], + [{ test: "route", format: undefined }, "/route"], + [{ test: "route", format: "" }, null], + [{ test: "route", format: "foo" }, "/route.foo"] + ] + ], + [ + "/test.:format(.*)z", + { + end: false + }, + [ + "/test", + { + name: "format", + prefix: ".", + suffix: "", + modifier: "", + pattern: ".*" + }, + "z" + ], + [ + ["/test.abc", null], + ["/test.z", ["/test.z", ""]], + ["/test.abcz", ["/test.abcz", "abc"]] + ], + [ + [{}, null], + [{ format: "" }, "/test.z"], + [{ format: "foo" }, "/test.fooz"] + ] + ], + /** + * Unnamed params. + */ + [ + "/(\\d+)", + undefined, + [ + { + name: 0, + prefix: "/", + suffix: "", + modifier: "", + pattern: "\\d+" + } + ], + [ + ["/123", ["/123", "123"]], + ["/abc", null], + ["/123/abc", null] + ], + [ + [{}, null], + [{ "0": "123" }, "/123"] + ] + ], + [ + "/(\\d+)", + { + end: false + }, + [ + { + name: 0, + prefix: "/", + suffix: "", + modifier: "", + pattern: "\\d+" + } + ], + [ + ["/123", ["/123", "123"]], + ["/abc", null], + ["/123/abc", ["/123", "123"]], + ["/123/", ["/123/", "123"]] + ], + [[{ "0": "123" }, "/123"]] + ], + [ + "/(\\d+)?", + undefined, + [ + { + name: 0, + prefix: "/", + suffix: "", + modifier: "?", + pattern: "\\d+" + } + ], + [ + ["/", ["/", undefined]], + ["/123", ["/123", "123"]] + ], + [ + [{}, ""], + [{ "0": "123" }, "/123"] + ] + ], + [ + "/(.*)", + undefined, + [ + { + name: 0, + prefix: "/", + suffix: "", + modifier: "", + pattern: ".*" + } + ], + [ + ["/", ["/", ""]], + ["/route", ["/route", "route"]], + ["/route/nested", ["/route/nested", "route/nested"]] + ], + [ + [{ "0": "" }, "/"], + [{ "0": "123" }, "/123"] + ] + ], + [ + "/route\\(\\\\(\\d+\\\\)\\)", + undefined, + [ + "/route(\\", + { + name: 0, + prefix: "", + suffix: "", + modifier: "", + pattern: "\\d+\\\\" + }, + ")" + ], + [["/route(\\123\\)", ["/route(\\123\\)", "123\\"]]], + [] + ], + [ + "{/login}?", + undefined, + [ + { + name: "", + prefix: "/login", + suffix: "", + modifier: "?", + pattern: "" + } + ], + [ + ["/", ["/"]], + ["/login", ["/login"]] + ], + [ + [null, ""], + [{ "": "" }, "/login"] + ] + ], + [ + "{/login}", + undefined, + [ + { + name: "", + prefix: "/login", + suffix: "", + modifier: "", + pattern: "" + } + ], + [ + ["/", null], + ["/login", ["/login"]] + ], + [[{ "": "" }, "/login"]] + ], + [ + "{/(.*)}", + undefined, + [ + { + name: 0, + prefix: "/", + suffix: "", + modifier: "", + pattern: ".*" + } + ], + [ + ["/", ["/", ""]], + ["/login", ["/login", "login"]] + ], + [[{ 0: "test" }, "/test"]] + ], + /** + * Regexps. + */ + [/.*/, undefined, [], [["/match/anything", ["/match/anything"]]], []], + [ + /(.*)/, + undefined, + [ + { + name: 0, + prefix: "", + suffix: "", + modifier: "", + pattern: "" + } + ], + [["/match/anything", ["/match/anything", "/match/anything"]]], + [] + ], + [ + /\/(\d+)/, + undefined, + [ + { + name: 0, + prefix: "", + suffix: "", + modifier: "", + pattern: "" + } + ], + [ + ["/abc", null], + ["/123", ["/123", "123"]] + ], + [] + ], + /** + * Mixed arrays. + */ + [ + ["/test", /\/(\d+)/], + undefined, + [ + { + name: 0, + prefix: "", + suffix: "", + modifier: "", + pattern: "" + } + ], + [["/test", ["/test", undefined]]], + [] + ], + [ + ["/:test(\\d+)", /(.*)/], + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "\\d+" + }, + { + name: 0, + prefix: "", + suffix: "", + modifier: "", + pattern: "" + } + ], + [ + ["/123", ["/123", "123", undefined]], + ["/abc", ["/abc", undefined, "/abc"]] + ], + [] + ], + /** + * Correct names and indexes. + */ + [ + ["/:test", "/route/:test"], + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/test", ["/test", "test", undefined]], + ["/route/test", ["/route/test", undefined, "test"]] + ], + [] + ], + [ + [/^\/([^\/]+)$/, /^\/route\/([^\/]+)$/], + undefined, + [ + { + name: 0, + prefix: "", + suffix: "", + modifier: "", + pattern: "" + }, + { + name: 0, + prefix: "", + suffix: "", + modifier: "", + pattern: "" + } + ], + [ + ["/test", ["/test", "test", undefined]], + ["/route/test", ["/route/test", undefined, "test"]] + ], + [] + ], + /** + * Ignore non-matching groups in regexps. + */ + [ + /(?:.*)/, + undefined, + [], + [["/anything/you/want", ["/anything/you/want"]]], + [] + ], + /** + * Respect escaped characters. + */ + [ + "/\\(testing\\)", + undefined, + ["/(testing)"], + [ + ["/testing", null], + ["/(testing)", ["/(testing)"]] + ], + [[null, "/(testing)"]] + ], + [ + "/.\\+\\*\\?\\{\\}=^!\\:$[]|", + undefined, + ["/.+*?{}=^!:$[]|"], + [["/.+*?{}=^!:$[]|", ["/.+*?{}=^!:$[]|"]]], + [[null, "/.+*?{}=^!:$[]|"]] + ], + [ + "/test\\/:uid(u\\d+)?:cid(c\\d+)?", + undefined, + [ + "/test/", + { + name: "uid", + prefix: "", + suffix: "", + modifier: "?", + pattern: "u\\d+" + }, + { + name: "cid", + prefix: "", + suffix: "", + modifier: "?", + pattern: "c\\d+" + } + ], + [ + ["/test", null], + ["/test/", ["/test/", undefined, undefined]], + ["/test/u123", ["/test/u123", "u123", undefined]], + ["/test/c123", ["/test/c123", undefined, "c123"]] + ], + [ + [{ uid: "u123" }, "/test/u123"], + [{ cid: "c123" }, "/test/c123"], + [{ cid: "u123" }, null] + ] + ], + /** + * Unnamed group prefix. + */ + [ + "/{apple-}?icon-:res(\\d+).png", + undefined, + [ + "/", + { + name: "", + prefix: "apple-", + suffix: "", + modifier: "?", + pattern: "" + }, + "icon-", + { + name: "res", + prefix: "", + suffix: "", + modifier: "", + pattern: "\\d+" + }, + ".png" + ], + [ + ["/icon-240.png", ["/icon-240.png", "240"]], + ["/apple-icon-240.png", ["/apple-icon-240.png", "240"]] + ], + [] + ], + /** + * Random examples. + */ + [ + "/:foo/:bar", + undefined, + [ + { + name: "foo", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + { + name: "bar", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [["/match/route", ["/match/route", "match", "route"]]], + [[{ foo: "a", bar: "b" }, "/a/b"]] + ], + [ + "/:foo\\(test\\)/bar", + undefined, + [ + { + name: "foo", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + "(test)/bar" + ], + [], + [] + ], + [ + "/:remote([\\w-.]+)/:user([\\w-]+)", + undefined, + [ + { + name: "remote", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[\\w-.]+" + }, + { + name: "user", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[\\w-]+" + } + ], + [ + ["/endpoint/user", ["/endpoint/user", "endpoint", "user"]], + ["/endpoint/user-name", ["/endpoint/user-name", "endpoint", "user-name"]], + ["/foo.bar/user-name", ["/foo.bar/user-name", "foo.bar", "user-name"]] + ], + [ + [{ remote: "foo", user: "bar" }, "/foo/bar"], + [{ remote: "foo.bar", user: "uno" }, "/foo.bar/uno"] + ] + ], + [ + "/:foo\\?", + undefined, + [ + { + name: "foo", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + "?" + ], + [["/route?", ["/route?", "route"]]], + [[{ foo: "bar" }, "/bar?"]] + ], + [ + "/:foo+baz", + undefined, + [ + { + name: "foo", + prefix: "/", + suffix: "", + modifier: "+", + pattern: "[^\\/#\\?]+?" + }, + "baz" + ], + [ + ["/foobaz", ["/foobaz", "foo"]], + ["/foo/barbaz", ["/foo/barbaz", "foo/bar"]], + ["/baz", null] + ], + [ + [{ foo: "foo" }, "/foobaz"], + [{ foo: "foo/bar" }, "/foo%2Fbarbaz", { encode: encodeURIComponent }], + [{ foo: ["foo", "bar"] }, "/foo/barbaz"] + ] + ], + [ + "\\/:pre?baz", + undefined, + [ + "/", + { + name: "pre", + prefix: "", + suffix: "", + modifier: "?", + pattern: "[^\\/#\\?]+?" + }, + "baz" + ], + [ + ["/foobaz", ["/foobaz", "foo"]], + ["/baz", ["/baz", undefined]] + ], + [ + [{}, "/baz"], + [{ pre: "foo" }, "/foobaz"] + ] + ], + [ + "/:foo\\(:bar?\\)", + undefined, + [ + { + name: "foo", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + "(", + { + name: "bar", + prefix: "", + suffix: "", + modifier: "?", + pattern: "[^\\/#\\?]+?" + }, + ")" + ], + [ + ["/hello(world)", ["/hello(world)", "hello", "world"]], + ["/hello()", ["/hello()", "hello", undefined]] + ], + [ + [{ foo: "hello", bar: "world" }, "/hello(world)"], + [{ foo: "hello" }, "/hello()"] + ] + ], + [ + "/:postType(video|audio|text)(\\+.+)?", + undefined, + [ + { + name: "postType", + prefix: "/", + suffix: "", + modifier: "", + pattern: "video|audio|text" + }, + { + name: 0, + prefix: "", + suffix: "", + modifier: "?", + pattern: "\\+.+" + } + ], + [ + ["/video", ["/video", "video", undefined]], + ["/video+test", ["/video+test", "video", "+test"]], + ["/video+", null] + ], + [ + [{ postType: "video" }, "/video"], + [{ postType: "random" }, null] + ] + ], + [ + "/:foo?/:bar?-ext", + undefined, + [ + { + name: "foo", + prefix: "/", + suffix: "", + modifier: "?", + pattern: "[^\\/#\\?]+?" + }, + { + name: "bar", + prefix: "/", + suffix: "", + modifier: "?", + pattern: "[^\\/#\\?]+?" + }, + "-ext" + ], + [ + ["/-ext", null], + ["-ext", ["-ext", undefined, undefined]], + ["/foo-ext", ["/foo-ext", "foo", undefined]], + ["/foo/bar-ext", ["/foo/bar-ext", "foo", "bar"]], + ["/foo/-ext", null] + ], + [ + [{}, "-ext"], + [{ foo: "foo" }, "/foo-ext"], + [{ bar: "bar" }, "/bar-ext"], + [{ foo: "foo", bar: "bar" }, "/foo/bar-ext"] + ] + ], + [ + "/:required/:optional?-ext", + undefined, + [ + { + name: "required", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + { + name: "optional", + prefix: "/", + suffix: "", + modifier: "?", + pattern: "[^\\/#\\?]+?" + }, + "-ext" + ], + [ + ["/foo-ext", ["/foo-ext", "foo", undefined]], + ["/foo/bar-ext", ["/foo/bar-ext", "foo", "bar"]], + ["/foo/-ext", null] + ], + [[{ required: "foo" }, "/foo-ext"]] + ], + /** + * Unicode characters. + */ + [ + "/:foo", + undefined, + [ + { + name: "foo", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [["/café", ["/café", "café"]]], + [ + [{ foo: "café" }, "/café"], + [{ foo: "café" }, "/caf%C3%A9", { encode: encodeURIComponent }] + ] + ], + ["/café", undefined, ["/café"], [["/café", ["/café"]]], [[null, "/café"]]], + [ + "/café", + { encode: encodeURI }, + ["/café"], + [["/caf%C3%A9", ["/caf%C3%A9"]]], + [[null, "/café"]] + ], + [ + "packages/", + undefined, + ["packages/"], + [ + ["packages", null], + ["packages/", ["packages/"]] + ], + [[null, "packages/"]] + ], + /** + * Hostnames. + */ + [ + ":domain.com", + { + delimiter: "." + }, + [ + { + name: "domain", + prefix: "", + suffix: "", + modifier: "", + pattern: "[^\\.]+?" + }, + ".com" + ], + [ + ["example.com", ["example.com", "example"]], + ["github.com", ["github.com", "github"]] + ], + [ + [{ domain: "example" }, "example.com"], + [{ domain: "github" }, "github.com"] + ] + ], + [ + "mail.:domain.com", + { + delimiter: "." + }, + [ + "mail", + { + name: "domain", + prefix: ".", + suffix: "", + modifier: "", + pattern: "[^\\.]+?" + }, + ".com" + ], + [ + ["mail.example.com", ["mail.example.com", "example"]], + ["mail.github.com", ["mail.github.com", "github"]] + ], + [ + [{ domain: "example" }, "mail.example.com"], + [{ domain: "github" }, "mail.github.com"] + ] + ], + [ + "example.:ext", + {}, + [ + "example", + { + name: "ext", + prefix: ".", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["example.com", ["example.com", "com"]], + ["example.org", ["example.org", "org"]] + ], + [ + [{ ext: "com" }, "example.com"], + [{ ext: "org" }, "example.org"] + ] + ], + [ + "this is", + { + delimiter: " ", + end: false + }, + ["this is"], + [ + ["this is a test", ["this is"]], + ["this isn't", null] + ], + [[null, "this is"]] + ], + /** + * Ends with. + */ + [ + "/test", + { + endsWith: "?" + }, + ["/test"], + [ + ["/test", ["/test"]], + ["/test?query=string", ["/test"]], + ["/test/?query=string", ["/test/"]], + ["/testx", null] + ], + [[null, "/test"]] + ], + [ + "/test", + { + endsWith: "?", + strict: true + }, + ["/test"], + [ + ["/test?query=string", ["/test"]], + ["/test/?query=string", null] + ], + [[null, "/test"]] + ], + /** + * Custom prefixes. + */ + [ + "{$:foo}{$:bar}?", + {}, + [ + { + name: "foo", + pattern: "[^\\/#\\?]+?", + prefix: "$", + suffix: "", + modifier: "" + }, + { + name: "bar", + pattern: "[^\\/#\\?]+?", + prefix: "$", + suffix: "", + modifier: "?" + } + ], + [ + ["$x", ["$x", "x", undefined]], + ["$x$y", ["$x$y", "x", "y"]] + ], + [ + [{ foo: "foo" }, "$foo"], + [{ foo: "foo", bar: "bar" }, "$foo$bar"] + ] + ], + [ + "name/:attr1?{-:attr2}?{-:attr3}?", + {}, + [ + "name", + { + name: "attr1", + pattern: "[^\\/#\\?]+?", + prefix: "/", + suffix: "", + modifier: "?" + }, + { + name: "attr2", + pattern: "[^\\/#\\?]+?", + prefix: "-", + suffix: "", + modifier: "?" + }, + { + name: "attr3", + pattern: "[^\\/#\\?]+?", + prefix: "-", + suffix: "", + modifier: "?" + } + ], + [ + ["name/test", ["name/test", "test", undefined, undefined]], + ["name/1", ["name/1", "1", undefined, undefined]], + ["name/1-2", ["name/1-2", "1", "2", undefined]], + ["name/1-2-3", ["name/1-2-3", "1", "2", "3"]], + ["name/foo-bar/route", null], + ["name/test/route", null] + ], + [ + [{}, "name"], + [{ attr1: "test" }, "name/test"], + [{ attr2: "attr" }, "name-attr"] + ] + ], + /** + * Case-sensitive compile tokensToFunction params. + */ + [ + "/:test(abc)", + { + sensitive: true + }, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "abc" + } + ], + [ + ["/abc", ["/abc", "abc"]], + ["/ABC", null] + ], + [ + [{ test: "abc" }, "/abc"], + [{ test: "ABC" }, null] + ] + ], + [ + "/:test(abc)", + {}, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "abc" + } + ], + [ + ["/abc", ["/abc", "abc"]], + ["/ABC", ["/ABC", "ABC"]] + ], + [ + [{ test: "abc" }, "/abc"], + [{ test: "ABC" }, "/ABC"] + ] + ], + /** + * Nested parentheses. + */ + [ + "/:test(\\d+(?:\\.\\d+)?)", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "\\d+(?:\\.\\d+)?" + } + ], + [ + ["/123", ["/123", "123"]], + ["/abc", null], + ["/123/abc", null], + ["/123.123", ["/123.123", "123.123"]], + ["/123.abc", null] + ], + [ + [{ test: 123 }, "/123"], + [{ test: 123.123 }, "/123.123"], + [{ test: "abc" }, null], + [{ test: "123" }, "/123"], + [{ test: "123.123" }, "/123.123"], + [{ test: "123.abc" }, null] + ] + ], + [ + "/:test((?!login)[^/]+)", + undefined, + [ + { + name: "test", + prefix: "/", + suffix: "", + modifier: "", + pattern: "(?!login)[^/]+" + } + ], + [ + ["/route", ["/route", "route"]], + ["/login", null] + ], + [ + [{ test: "route" }, "/route"], + [{ test: "login" }, null] + ] + ], + /** + * https://github.com/pillarjs/path-to-regexp/issues/206 + */ + [ + "/user(s)?/:user", + undefined, + [ + "/user", + { + name: 0, + prefix: "", + suffix: "", + modifier: "?", + pattern: "s" + }, + { + name: "user", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/user/123", ["/user/123", undefined, "123"]], + ["/users/123", ["/users/123", "s", "123"]] + ], + [[{ user: "123" }, "/user/123"]] + ], + /** + * https://github.com/pillarjs/path-to-regexp/issues/209 + */ + [ + "/whatever/:foo\\?query=str", + undefined, + [ + "/whatever", + { + name: "foo", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }, + "?query=str" + ], + [["/whatever/123?query=str", ["/whatever/123?query=str", "123"]]], + [[{ foo: "123" }, "/whatever/123?query=str"]] + ], + [ + "/whatever/:foo", + { + end: false + }, + [ + "/whatever", + { + name: "foo", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + } + ], + [ + ["/whatever/123", ["/whatever/123", "123"]], + ["/whatever/123/path", ["/whatever/123", "123"]], + ["/whatever/123#fragment", ["/whatever/123", "123"]], + ["/whatever/123?query=str", ["/whatever/123", "123"]] + ], + [ + [{ foo: "123" }, "/whatever/123"], + [{ foo: "#" }, null] + ] + ] +]; +/** + * Dynamically generate the entire test suite. + */ +describe("path-to-regexp", function () { + var TEST_PATH = "/user/:id"; + var TEST_PARAM = { + name: "id", + prefix: "/", + suffix: "", + modifier: "", + pattern: "[^\\/#\\?]+?" + }; + describe("arguments", function () { + it("should work without different call combinations", function () { + pathToRegexp.pathToRegexp("/test"); + pathToRegexp.pathToRegexp("/test", []); + pathToRegexp.pathToRegexp("/test", undefined, {}); + pathToRegexp.pathToRegexp(/^\/test/); + pathToRegexp.pathToRegexp(/^\/test/, []); + pathToRegexp.pathToRegexp(/^\/test/, undefined, {}); + pathToRegexp.pathToRegexp(["/a", "/b"]); + pathToRegexp.pathToRegexp(["/a", "/b"], []); + pathToRegexp.pathToRegexp(["/a", "/b"], undefined, {}); + }); + it("should accept an array of keys as the second argument", function () { + var keys = []; + var re = pathToRegexp.pathToRegexp(TEST_PATH, keys, { end: false }); + expect(keys).toEqual([TEST_PARAM]); + expect(exec(re, "/user/123/show")).toEqual(["/user/123", "123"]); + }); + it("should throw on non-capturing pattern", function () { + expect(function () { + pathToRegexp.pathToRegexp("/:foo(?:\\d+(\\.\\d+)?)"); + }).toThrow(new TypeError('Pattern cannot start with "?" at 6')); + }); + it("should throw on nested capturing group", function () { + expect(function () { + pathToRegexp.pathToRegexp("/:foo(\\d+(\\.\\d+)?)"); + }).toThrow(new TypeError("Capturing groups are not allowed at 9")); + }); + it("should throw on unbalanced pattern", function () { + expect(function () { + pathToRegexp.pathToRegexp("/:foo(abc"); + }).toThrow(new TypeError("Unbalanced pattern at 5")); + }); + it("should throw on missing pattern", function () { + expect(function () { + pathToRegexp.pathToRegexp("/:foo()"); + }).toThrow(new TypeError("Missing pattern at 5")); + }); + it("should throw on missing name", function () { + expect(function () { + pathToRegexp.pathToRegexp("/:(test)"); + }).toThrow(new TypeError("Missing parameter name at 1")); + }); + it("should throw on nested groups", function () { + expect(function () { + pathToRegexp.pathToRegexp("/{a{b:foo}}"); + }).toThrow(new TypeError("Unexpected OPEN at 3, expected CLOSE")); + }); + it("should throw on misplaced modifier", function () { + expect(function () { + pathToRegexp.pathToRegexp("/foo?"); + }).toThrow(new TypeError("Unexpected MODIFIER at 4, expected END")); + }); + }); + describe("tokens", function () { + var tokens = pathToRegexp.parse(TEST_PATH); + it("should expose method to compile tokens to regexp", function () { + var re = pathToRegexp.tokensToRegexp(tokens); + expect(exec(re, "/user/123")).toEqual(["/user/123", "123"]); + }); + it("should expose method to compile tokens to a path function", function () { + var fn = pathToRegexp.tokensToFunction(tokens); + expect(fn({ id: 123 })).toEqual("/user/123"); + }); + }); + describe("rules", function () { + TESTS.forEach(function (test) { + var path = test[0], opts = test[1], tokens = test[2], matchCases = test[3], compileCases = test[4]; + describe(util.inspect(path), function () { + var keys = []; + var re = pathToRegexp.pathToRegexp(path, keys, opts); + // Parsing and compiling is only supported with string input. + if (typeof path === "string") { + it("should parse", function () { + expect(pathToRegexp.parse(path, opts)).toEqual(tokens); + }); + describe("compile", function () { + compileCases.forEach(function (io) { + var params = io[0], result = io[1], options = io[2]; + var toPath = pathToRegexp.compile(path, __assign(__assign({}, opts), options)); + if (result !== null) { + it("should compile using " + util.inspect(params), function () { + expect(toPath(params)).toEqual(result); + }); + } + else { + it("should not compile using " + util.inspect(params), function () { + expect(function () { + toPath(params); + }).toThrow(TypeError); + }); + } + }); + }); + } + else { + it("should parse keys", function () { + expect(keys).toEqual(tokens.filter(function (token) { + return typeof token !== "string"; + })); + }); + } + describe("match" + (opts ? " using " + util.inspect(opts) : ""), function () { + matchCases.forEach(function (io) { + var pathname = io[0], matches = io[1], params = io[2], options = io[3]; + var message = "should " + (matches ? "" : "not ") + "match " + util.inspect(pathname); + it(message, function () { + expect(exec(re, pathname)).toEqual(matches); + }); + if (typeof path === "string" && params !== undefined) { + var match_1 = pathToRegexp.match(path, options); + it(message + " params", function () { + expect(match_1(pathname)).toEqual(params); + }); + } + }); + }); + }); + }); + }); + describe("compile errors", function () { + it("should throw when a required param is undefined", function () { + var toPath = pathToRegexp.compile("/a/:b/c"); + expect(function () { + toPath(); + }).toThrow(new TypeError('Expected "b" to be a string')); + }); + it("should throw when it does not match the pattern", function () { + var toPath = pathToRegexp.compile("/:foo(\\d+)"); + expect(function () { + toPath({ foo: "abc" }); + }).toThrow(new TypeError('Expected "foo" to match "\\d+", but got "abc"')); + }); + it("should throw when expecting a repeated value", function () { + var toPath = pathToRegexp.compile("/:foo+"); + expect(function () { + toPath({ foo: [] }); + }).toThrow(new TypeError('Expected "foo" to not be empty')); + }); + it("should throw when not expecting a repeated value", function () { + var toPath = pathToRegexp.compile("/:foo"); + expect(function () { + toPath({ foo: [] }); + }).toThrow(new TypeError('Expected "foo" to not repeat, but got an array')); + }); + it("should throw when repeated value does not match", function () { + var toPath = pathToRegexp.compile("/:foo(\\d+)+"); + expect(function () { + toPath({ foo: [1, 2, 3, "a"] }); + }).toThrow(new TypeError('Expected all "foo" to match "\\d+", but got "a"')); + }); + }); +}); +/** + * Execute a regular expression and return a flat array for comparison. + * + * @param {RegExp} re + * @param {String} str + * @return {Array} + */ +function exec(re, str) { + var match = re.exec(str); + return match && Array.prototype.slice.call(match); +} +//# sourceMappingURL=index.spec.js.map \ No newline at end of file diff --git a/packages/next/src/compiled/path-to-regexp/index.spec.js.map b/packages/next/src/compiled/path-to-regexp/index.spec.js.map new file mode 100644 index 0000000000000..78d8e93a0060a --- /dev/null +++ b/packages/next/src/compiled/path-to-regexp/index.spec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2BAA6B;AAC7B,sCAAwC;AAiBxC;;GAEG;AACH,IAAM,KAAK,GAAW;IACpB;;OAEG;IACH;QACE,GAAG;QACH,SAAS;QACT,CAAC,GAAG,CAAC;QACL;YACE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;YACjD,CAA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exp from \"./index\";\n\ntype Test = [\n pathToRegexp.Path,\n (pathToRegexp.TokensToRegexpOptions & pathToRegexp.ParseOptions) | undefined,\n pathToRegexp.Token[],\n Array<\n [\n string,\n (string | undefined)[] | null,\n pathToRegexp.Match?,\n pathToRegexp.RegexpToFunctionOptions?\n ]\n >,\n Array<[any, string | null, pathToRegexp.TokensToFunctionOptions?]>\n];\n\n/**\n * An array of test cases with expected inputs and outputs.\n */\nconst TESTS: Test[] = [\n /**\n * Simple paths.\n */\n [\n \"/\",\n undefined,\n [\"/\"],\n [\n [\"/\", [\"/\"], { path: \"/\", index: 0, params: {} }],\n [\"/route\", null, false]\n ],\n [\n [null, \"/\"],\n [{}, \"/\"],\n [{ id: 123 }, \"/\"]\n ]\n ],\n [\n \"/test\",\n undefined,\n [\"/test\"],\n [\n [\"/test\", [\"/test\"], { path: \"/test\", index: 0, params: {} }],\n [\"/route\", null, false],\n [\"/test/route\", null, false],\n [\"/test/\", [\"/test/\"], { path: \"/test/\", index: 0, params: {} }]\n ],\n [\n [null, \"/test\"],\n [{}, \"/test\"]\n ]\n ],\n [\n \"/test/\",\n undefined,\n [\"/test/\"],\n [\n [\"/test\", null],\n [\"/test/\", [\"/test/\"]],\n [\"/test//\", [\"/test//\"]]\n ],\n [[null, \"/test/\"]]\n ],\n\n /**\n * Case-sensitive paths.\n */\n [\n \"/test\",\n {\n sensitive: true\n },\n [\"/test\"],\n [\n [\"/test\", [\"/test\"]],\n [\"/TEST\", null]\n ],\n [[null, \"/test\"]]\n ],\n [\n \"/TEST\",\n {\n sensitive: true\n },\n [\"/TEST\"],\n [\n [\"/test\", null],\n [\"/TEST\", [\"/TEST\"]]\n ],\n [[null, \"/TEST\"]]\n ],\n\n /**\n * Strict mode.\n */\n [\n \"/test\",\n {\n strict: true\n },\n [\"/test\"],\n [\n [\"/test\", [\"/test\"]],\n [\"/test/\", null],\n [\"/TEST\", [\"/TEST\"]]\n ],\n [[null, \"/test\"]]\n ],\n [\n \"/test/\",\n {\n strict: true\n },\n [\"/test/\"],\n [\n [\"/test\", null],\n [\"/test/\", [\"/test/\"]],\n [\"/test//\", null]\n ],\n [[null, \"/test/\"]]\n ],\n\n /**\n * Non-ending mode.\n */\n [\n \"/test\",\n {\n end: false\n },\n [\"/test\"],\n [\n [\"/test\", [\"/test\"]],\n [\"/test/\", [\"/test/\"]],\n [\"/test/route\", [\"/test\"]],\n [\"/route\", null]\n ],\n [[null, \"/test\"]]\n ],\n [\n \"/test/\",\n {\n end: false\n },\n [\"/test/\"],\n [\n [\"/test\", null],\n [\"/test/route\", [\"/test/\"]],\n [\"/test//\", [\"/test//\"]],\n [\"/test//route\", [\"/test/\"]]\n ],\n [[null, \"/test/\"]]\n ],\n [\n \"/:test\",\n {\n end: false\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\n \"/route\",\n [\"/route\", \"route\"],\n { path: \"/route\", index: 0, params: { test: \"route\" } }\n ],\n [\n \"/caf%C3%A9\",\n [\"/caf%C3%A9\", \"caf%C3%A9\"],\n { path: \"/caf%C3%A9\", index: 0, params: { test: \"caf%C3%A9\" } }\n ],\n [\n \"/caf%C3%A9\",\n [\"/caf%C3%A9\", \"caf%C3%A9\"],\n { path: \"/caf%C3%A9\", index: 0, params: { test: \"café\" } },\n { decode: decodeURIComponent }\n ]\n ],\n [\n [{}, null],\n [{ test: \"abc\" }, \"/abc\"],\n [{ test: \"a+b\" }, \"/a+b\"],\n [{ test: \"a+b\" }, \"/test\", { encode: (_, token) => String(token.name) }],\n [{ test: \"a+b\" }, \"/a%2Bb\", { encode: encodeURIComponent }]\n ]\n ],\n [\n \"/:test/\",\n {\n end: false\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"/\"\n ],\n [\n [\"/route\", null],\n [\"/route/\", [\"/route/\", \"route\"]]\n ],\n [[{ test: \"abc\" }, \"/abc/\"]]\n ],\n [\n \"\",\n {\n end: false\n },\n [],\n [\n [\"\", [\"\"]],\n [\"/\", [\"/\"]],\n [\"route\", [\"\"]],\n [\"/route\", [\"\"]],\n [\"/route/\", [\"\"]]\n ],\n [[null, \"\"]]\n ],\n\n /**\n * Non-starting mode.\n */\n [\n \"/test\",\n {\n start: false\n },\n [\"/test\"],\n [\n [\"/test\", [\"/test\"]],\n [\"/test/\", [\"/test/\"]],\n [\"/route/test\", [\"/test\"]],\n [\"/test/route\", null],\n [\"/route/test/deep\", null],\n [\"/route\", null]\n ],\n [[null, \"/test\"]]\n ],\n [\n \"/test/\",\n {\n start: false\n },\n [\"/test/\"],\n [\n [\"/test\", null],\n [\"/test/route\", null],\n [\"/test//route\", null],\n [\"/test//\", [\"/test//\"]],\n [\"/route/test/\", [\"/test/\"]]\n ],\n [[null, \"/test/\"]]\n ],\n [\n \"/:test\",\n {\n start: false\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [[\"/route\", [\"/route\", \"route\"]]],\n [\n [{}, null],\n [{ test: \"abc\" }, \"/abc\"],\n [{ test: \"a+b\" }, \"/a+b\"],\n [{ test: \"a+b\" }, \"/test\", { encode: (_, token) => String(token.name) }],\n [{ test: \"a+b\" }, \"/a%2Bb\", { encode: encodeURIComponent }]\n ]\n ],\n [\n \"/:test/\",\n {\n start: false\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"/\"\n ],\n [\n [\"/route\", null],\n [\"/route/\", [\"/route/\", \"route\"]]\n ],\n [[{ test: \"abc\" }, \"/abc/\"]]\n ],\n [\n \"\",\n {\n start: false\n },\n [],\n [\n [\"\", [\"\"]],\n [\"/\", [\"/\"]],\n [\"route\", [\"\"]],\n [\"/route\", [\"\"]],\n [\"/route/\", [\"/\"]]\n ],\n [[null, \"\"]]\n ],\n\n /**\n * Combine modes.\n */\n [\n \"/test\",\n {\n end: false,\n strict: true\n },\n [\"/test\"],\n [\n [\"/test\", [\"/test\"]],\n [\"/test/\", [\"/test\"]],\n [\"/test/route\", [\"/test\"]]\n ],\n [[null, \"/test\"]]\n ],\n [\n \"/test/\",\n {\n end: false,\n strict: true\n },\n [\"/test/\"],\n [\n [\"/test\", null],\n [\"/test/\", [\"/test/\"]],\n [\"/test//\", [\"/test/\"]],\n [\"/test/route\", [\"/test/\"]]\n ],\n [[null, \"/test/\"]]\n ],\n [\n \"/test.json\",\n {\n end: false,\n strict: true\n },\n [\"/test.json\"],\n [\n [\"/test.json\", [\"/test.json\"]],\n [\"/test.json.hbs\", null],\n [\"/test.json/route\", [\"/test.json\"]]\n ],\n [[null, \"/test.json\"]]\n ],\n [\n \"/:test\",\n {\n end: false,\n strict: true\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/route\", [\"/route\", \"route\"]],\n [\"/route/\", [\"/route\", \"route\"]]\n ],\n [\n [{}, null],\n [{ test: \"abc\" }, \"/abc\"]\n ]\n ],\n [\n \"/:test/\",\n {\n end: false,\n strict: true\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"/\"\n ],\n [\n [\"/route\", null],\n [\"/route/\", [\"/route/\", \"route\"]]\n ],\n [[{ test: \"foobar\" }, \"/foobar/\"]]\n ],\n [\n \"/test\",\n {\n start: false,\n end: false\n },\n [\"/test\"],\n [\n [\"/test\", [\"/test\"]],\n [\"/test/\", [\"/test/\"]],\n [\"/test/route\", [\"/test\"]],\n [\"/route/test/deep\", [\"/test\"]]\n ],\n [[null, \"/test\"]]\n ],\n [\n \"/test/\",\n {\n start: false,\n end: false\n },\n [\"/test/\"],\n [\n [\"/test\", null],\n [\"/test/\", [\"/test/\"]],\n [\"/test//\", [\"/test//\"]],\n [\"/test/route\", [\"/test/\"]],\n [\"/route/test/deep\", [\"/test/\"]]\n ],\n [[null, \"/test/\"]]\n ],\n [\n \"/test.json\",\n {\n start: false,\n end: false\n },\n [\"/test.json\"],\n [\n [\"/test.json\", [\"/test.json\"]],\n [\"/test.json.hbs\", null],\n [\"/test.json/route\", [\"/test.json\"]],\n [\"/route/test.json/deep\", [\"/test.json\"]]\n ],\n [[null, \"/test.json\"]]\n ],\n [\n \"/:test\",\n {\n start: false,\n end: false\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/route\", [\"/route\", \"route\"]],\n [\"/route/\", [\"/route/\", \"route\"]]\n ],\n [\n [{}, null],\n [{ test: \"abc\" }, \"/abc\"]\n ]\n ],\n [\n \"/:test/\",\n {\n end: false,\n strict: true\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"/\"\n ],\n [\n [\"/route\", null],\n [\"/route/\", [\"/route/\", \"route\"]]\n ],\n [[{ test: \"foobar\" }, \"/foobar/\"]]\n ],\n\n /**\n * Arrays of simple paths.\n */\n [\n [\"/one\", \"/two\"],\n undefined,\n [],\n [\n [\"/one\", [\"/one\"]],\n [\"/two\", [\"/two\"]],\n [\"/three\", null],\n [\"/one/two\", null]\n ],\n []\n ],\n\n /**\n * Non-ending simple path.\n */\n [\n \"/test\",\n {\n end: false\n },\n [\"/test\"],\n [[\"/test/route\", [\"/test\"]]],\n [[null, \"/test\"]]\n ],\n\n /**\n * Single named parameter.\n */\n [\n \"/:test\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/route\", [\"/route\", \"route\"]],\n [\"/another\", [\"/another\", \"another\"]],\n [\"/something/else\", null],\n [\"/route.json\", [\"/route.json\", \"route.json\"]],\n [\"/something%2Felse\", [\"/something%2Felse\", \"something%2Felse\"]],\n [\n \"/something%2Felse%2Fmore\",\n [\"/something%2Felse%2Fmore\", \"something%2Felse%2Fmore\"]\n ],\n [\"/;,:@&=+$-_.!~*()\", [\"/;,:@&=+$-_.!~*()\", \";,:@&=+$-_.!~*()\"]]\n ],\n [\n [{ test: \"route\" }, \"/route\"],\n [\n { test: \"something/else\" },\n \"/something%2Felse\",\n { encode: encodeURIComponent }\n ],\n [\n { test: \"something/else/more\" },\n \"/something%2Felse%2Fmore\",\n { encode: encodeURIComponent }\n ]\n ]\n ],\n [\n \"/:test\",\n {\n strict: true\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/route\", [\"/route\", \"route\"]],\n [\"/route/\", null]\n ],\n [[{ test: \"route\" }, \"/route\"]]\n ],\n [\n \"/:test/\",\n {\n strict: true\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"/\"\n ],\n [\n [\"/route/\", [\"/route/\", \"route\"]],\n [\"/route//\", null]\n ],\n [[{ test: \"route\" }, \"/route/\"]]\n ],\n [\n \"/:test\",\n {\n end: false\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/route.json\", [\"/route.json\", \"route.json\"]],\n [\"/route//\", [\"/route\", \"route\"]]\n ],\n [[{ test: \"route\" }, \"/route\"]]\n ],\n\n /**\n * Optional named parameter.\n */\n [\n \"/:test?\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\n \"/route\",\n [\"/route\", \"route\"],\n { path: \"/route\", index: 0, params: { test: \"route\" } }\n ],\n [\"/route/nested\", null, false],\n [\"/\", [\"/\", undefined], { path: \"/\", index: 0, params: {} }],\n [\"//\", null]\n ],\n [\n [null, \"\"],\n [{ test: \"foobar\" }, \"/foobar\"]\n ]\n ],\n [\n \"/:test?\",\n {\n strict: true\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/route\", [\"/route\", \"route\"]],\n [\"/\", null], // Questionable behaviour.\n [\"//\", null]\n ],\n [\n [null, \"\"],\n [{ test: \"foobar\" }, \"/foobar\"]\n ]\n ],\n [\n \"/:test?/\",\n {\n strict: true\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"/\"\n ],\n [\n [\"/route\", null],\n [\"/route/\", [\"/route/\", \"route\"]],\n [\"/\", [\"/\", undefined]],\n [\"//\", null]\n ],\n [\n [null, \"/\"],\n [{ test: \"foobar\" }, \"/foobar/\"]\n ]\n ],\n [\n \"/:test?/bar\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"/bar\"\n ],\n [\n [\"/bar\", [\"/bar\", undefined]],\n [\"/foo/bar\", [\"/foo/bar\", \"foo\"]]\n ],\n [\n [null, \"/bar\"],\n [{ test: \"foo\" }, \"/foo/bar\"]\n ]\n ],\n [\n \"/:test?-bar\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"-bar\"\n ],\n [\n [\"-bar\", [\"-bar\", undefined]],\n [\"/-bar\", null],\n [\"/foo-bar\", [\"/foo-bar\", \"foo\"]]\n ],\n [\n [undefined, \"-bar\"],\n [{ test: \"foo\" }, \"/foo-bar\"]\n ]\n ],\n [\n \"/:test*-bar\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"*\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"-bar\"\n ],\n [\n [\"-bar\", [\"-bar\", undefined]],\n [\"/-bar\", null],\n [\"/foo-bar\", [\"/foo-bar\", \"foo\"]],\n [\"/foo/baz-bar\", [\"/foo/baz-bar\", \"foo/baz\"]]\n ],\n [[{ test: \"foo\" }, \"/foo-bar\"]]\n ],\n\n /**\n * Repeated one or more times parameters.\n */\n [\n \"/:test+\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"+\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/\", null, false],\n [\n \"/route\",\n [\"/route\", \"route\"],\n { path: \"/route\", index: 0, params: { test: [\"route\"] } }\n ],\n [\n \"/some/basic/route\",\n [\"/some/basic/route\", \"some/basic/route\"],\n {\n path: \"/some/basic/route\",\n index: 0,\n params: { test: [\"some\", \"basic\", \"route\"] }\n }\n ],\n [\"//\", null, false]\n ],\n [\n [{}, null],\n [{ test: \"foobar\" }, \"/foobar\"],\n [{ test: [\"a\", \"b\", \"c\"] }, \"/a/b/c\"]\n ]\n ],\n [\n \"/:test(\\\\d+)+\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"+\",\n pattern: \"\\\\d+\"\n }\n ],\n [\n [\"/abc/456/789\", null],\n [\"/123/456/789\", [\"/123/456/789\", \"123/456/789\"]]\n ],\n [\n [{ test: \"abc\" }, null],\n [{ test: 123 }, \"/123\"],\n [{ test: [1, 2, 3] }, \"/1/2/3\"]\n ]\n ],\n [\n \"/route.:ext(json|xml)+\",\n undefined,\n [\n \"/route\",\n {\n name: \"ext\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"+\",\n pattern: \"json|xml\"\n }\n ],\n [\n [\"/route\", null],\n [\"/route.json\", [\"/route.json\", \"json\"]],\n [\"/route.xml.json\", [\"/route.xml.json\", \"xml.json\"]],\n [\"/route.html\", null]\n ],\n [\n [{ ext: \"foobar\" }, null],\n [{ ext: \"xml\" }, \"/route.xml\"],\n [{ ext: [\"xml\", \"json\"] }, \"/route.xml.json\"]\n ]\n ],\n [\n \"/route.:ext(\\\\w+)/test\",\n undefined,\n [\n \"/route\",\n {\n name: \"ext\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\\\\w+\"\n },\n \"/test\"\n ],\n [\n [\"/route\", null],\n [\"/route.json\", null],\n [\"/route.xml/test\", [\"/route.xml/test\", \"xml\"]],\n [\"/route.json.gz/test\", null]\n ],\n [[{ ext: \"xml\" }, \"/route.xml/test\"]]\n ],\n\n /**\n * Repeated zero or more times parameters.\n */\n [\n \"/:test*\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"*\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/\", [\"/\", undefined], { path: \"/\", index: 0, params: {} }],\n [\"//\", null, false],\n [\n \"/route\",\n [\"/route\", \"route\"],\n { path: \"/route\", index: 0, params: { test: [\"route\"] } }\n ],\n [\n \"/some/basic/route\",\n [\"/some/basic/route\", \"some/basic/route\"],\n {\n path: \"/some/basic/route\",\n index: 0,\n params: { test: [\"some\", \"basic\", \"route\"] }\n }\n ]\n ],\n [\n [{}, \"\"],\n [{ test: [] }, \"\"],\n [{ test: \"foobar\" }, \"/foobar\"],\n [{ test: [\"foo\", \"bar\"] }, \"/foo/bar\"]\n ]\n ],\n [\n \"/route.:ext([a-z]+)*\",\n undefined,\n [\n \"/route\",\n {\n name: \"ext\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"*\",\n pattern: \"[a-z]+\"\n }\n ],\n [\n [\"/route\", [\"/route\", undefined]],\n [\"/route.json\", [\"/route.json\", \"json\"]],\n [\"/route.json.xml\", [\"/route.json.xml\", \"json.xml\"]],\n [\"/route.123\", null]\n ],\n [\n [{}, \"/route\"],\n [{ ext: [] }, \"/route\"],\n [{ ext: \"123\" }, null],\n [{ ext: \"foobar\" }, \"/route.foobar\"],\n [{ ext: [\"foo\", \"bar\"] }, \"/route.foo.bar\"]\n ]\n ],\n\n /**\n * Custom named parameters.\n */\n [\n \"/:test(\\\\d+)\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\\\\d+\"\n }\n ],\n [\n [\"/123\", [\"/123\", \"123\"]],\n [\"/abc\", null],\n [\"/123/abc\", null]\n ],\n [\n [{ test: \"abc\" }, null],\n [{ test: \"abc\" }, \"/abc\", { validate: false }],\n [{ test: \"123\" }, \"/123\"]\n ]\n ],\n [\n \"/:test(\\\\d+)\",\n {\n end: false\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\\\\d+\"\n }\n ],\n [\n [\"/123\", [\"/123\", \"123\"]],\n [\"/abc\", null],\n [\"/123/abc\", [\"/123\", \"123\"]]\n ],\n [[{ test: \"123\" }, \"/123\"]]\n ],\n [\n \"/:test(.*)\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \".*\"\n }\n ],\n [\n [\"/anything/goes/here\", [\"/anything/goes/here\", \"anything/goes/here\"]],\n [\"/;,:@&=/+$-_.!/~*()\", [\"/;,:@&=/+$-_.!/~*()\", \";,:@&=/+$-_.!/~*()\"]]\n ],\n [\n [{ test: \"\" }, \"/\"],\n [{ test: \"abc\" }, \"/abc\"],\n [{ test: \"abc/123\" }, \"/abc%2F123\", { encode: encodeURIComponent }],\n [\n { test: \"abc/123/456\" },\n \"/abc%2F123%2F456\",\n { encode: encodeURIComponent }\n ]\n ]\n ],\n [\n \"/:route([a-z]+)\",\n undefined,\n [\n {\n name: \"route\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[a-z]+\"\n }\n ],\n [\n [\"/abcde\", [\"/abcde\", \"abcde\"]],\n [\"/12345\", null]\n ],\n [\n [{ route: \"\" }, null],\n [{ route: \"\" }, \"/\", { validate: false }],\n [{ route: \"123\" }, null],\n [{ route: \"123\" }, \"/123\", { validate: false }],\n [{ route: \"abc\" }, \"/abc\"]\n ]\n ],\n [\n \"/:route(this|that)\",\n undefined,\n [\n {\n name: \"route\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"this|that\"\n }\n ],\n [\n [\"/this\", [\"/this\", \"this\"]],\n [\"/that\", [\"/that\", \"that\"]],\n [\"/foo\", null]\n ],\n [\n [{ route: \"this\" }, \"/this\"],\n [{ route: \"foo\" }, null],\n [{ route: \"foo\" }, \"/foo\", { validate: false }],\n [{ route: \"that\" }, \"/that\"]\n ]\n ],\n [\n \"/:path(abc|xyz)*\",\n undefined,\n [\n {\n name: \"path\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"*\",\n pattern: \"abc|xyz\"\n }\n ],\n [\n [\"/abc\", [\"/abc\", \"abc\"]],\n [\"/abc/abc\", [\"/abc/abc\", \"abc/abc\"]],\n [\"/xyz/xyz\", [\"/xyz/xyz\", \"xyz/xyz\"]],\n [\"/abc/xyz\", [\"/abc/xyz\", \"abc/xyz\"]],\n [\"/abc/xyz/abc/xyz\", [\"/abc/xyz/abc/xyz\", \"abc/xyz/abc/xyz\"]],\n [\"/xyzxyz\", null]\n ],\n [\n [{ path: \"abc\" }, \"/abc\"],\n [{ path: [\"abc\", \"xyz\"] }, \"/abc/xyz\"],\n [{ path: [\"xyz\", \"abc\", \"xyz\"] }, \"/xyz/abc/xyz\"],\n [{ path: \"abc123\" }, null],\n [{ path: \"abc123\" }, \"/abc123\", { validate: false }],\n [{ path: \"abcxyz\" }, null],\n [{ path: \"abcxyz\" }, \"/abcxyz\", { validate: false }]\n ]\n ],\n\n /**\n * Prefixed slashes could be omitted.\n */\n [\n \"test\",\n undefined,\n [\"test\"],\n [\n [\"test\", [\"test\"]],\n [\"/test\", null]\n ],\n [[null, \"test\"]]\n ],\n [\n \":test\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"route\", [\"route\", \"route\"]],\n [\"/route\", null],\n [\"route/\", [\"route/\", \"route\"]]\n ],\n [\n [{ test: \"\" }, null],\n [{}, null],\n [{ test: null }, null],\n [{ test: \"route\" }, \"route\"]\n ]\n ],\n [\n \":test\",\n {\n strict: true\n },\n [\n {\n name: \"test\",\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"route\", [\"route\", \"route\"]],\n [\"/route\", null],\n [\"route/\", null]\n ],\n [[{ test: \"route\" }, \"route\"]]\n ],\n [\n \":test\",\n {\n end: false\n },\n [\n {\n name: \"test\",\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"route\", [\"route\", \"route\"]],\n [\"/route\", null],\n [\"route/\", [\"route/\", \"route\"]],\n [\"route/foobar\", [\"route\", \"route\"]]\n ],\n [[{ test: \"route\" }, \"route\"]]\n ],\n [\n \":test?\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"route\", [\"route\", \"route\"]],\n [\"/route\", null],\n [\"\", [\"\", undefined]],\n [\"route/foobar\", null]\n ],\n [\n [{}, \"\"],\n [{ test: \"\" }, null],\n [{ test: \"route\" }, \"route\"]\n ]\n ],\n [\n \"{:test/}+\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"\",\n suffix: \"/\",\n modifier: \"+\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"route/\", [\"route/\", \"route\"]],\n [\"/route\", null],\n [\"\", null],\n [\"foo/bar/\", [\"foo/bar/\", \"foo/bar\"]]\n ],\n [\n [{}, null],\n [{ test: \"\" }, null],\n [{ test: [\"route\"] }, \"route/\"],\n [{ test: [\"foo\", \"bar\"] }, \"foo/bar/\"]\n ]\n ],\n\n /**\n * Formats.\n */\n [\n \"/test.json\",\n undefined,\n [\"/test.json\"],\n [\n [\"/test.json\", [\"/test.json\"]],\n [\"/route.json\", null]\n ],\n [[{}, \"/test.json\"]]\n ],\n [\n \"/:test.json\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \".json\"\n ],\n [\n [\"/.json\", null],\n [\"/test.json\", [\"/test.json\", \"test\"]],\n [\"/route.json\", [\"/route.json\", \"route\"]],\n [\"/route.json.json\", [\"/route.json.json\", \"route.json\"]]\n ],\n [\n [{ test: \"\" }, null],\n [{ test: \"foo\" }, \"/foo.json\"]\n ]\n ],\n\n /**\n * Format params.\n */\n [\n \"/test.:format(\\\\w+)\",\n undefined,\n [\n \"/test\",\n {\n name: \"format\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\\\\w+\"\n }\n ],\n [\n [\"/test.html\", [\"/test.html\", \"html\"]],\n [\"/test.hbs.html\", null]\n ],\n [\n [{}, null],\n [{ format: \"\" }, null],\n [{ format: \"foo\" }, \"/test.foo\"]\n ]\n ],\n [\n \"/test.:format(\\\\w+).:format(\\\\w+)\",\n undefined,\n [\n \"/test\",\n {\n name: \"format\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\\\\w+\"\n },\n {\n name: \"format\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\\\\w+\"\n }\n ],\n [\n [\"/test.html\", null],\n [\"/test.hbs.html\", [\"/test.hbs.html\", \"hbs\", \"html\"]]\n ],\n [\n [{ format: \"foo.bar\" }, null],\n [{ format: \"foo\" }, \"/test.foo.foo\"]\n ]\n ],\n [\n \"/test{.:format}+\",\n undefined,\n [\n \"/test\",\n {\n name: \"format\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"+\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/test.html\", [\"/test.html\", \"html\"]],\n [\"/test.hbs.html\", [\"/test.hbs.html\", \"hbs.html\"]]\n ],\n [\n [{ format: [] }, null],\n [{ format: \"foo\" }, \"/test.foo\"],\n [{ format: [\"foo\", \"bar\"] }, \"/test.foo.bar\"]\n ]\n ],\n [\n \"/test.:format(\\\\w+)\",\n {\n end: false\n },\n [\n \"/test\",\n {\n name: \"format\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\\\\w+\"\n }\n ],\n [\n [\"/test.html\", [\"/test.html\", \"html\"]],\n [\"/test.hbs.html\", null]\n ],\n [[{ format: \"foo\" }, \"/test.foo\"]]\n ],\n [\n \"/test.:format.\",\n undefined,\n [\n \"/test\",\n {\n name: \"format\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \".\"\n ],\n [\n [\"/test.html.\", [\"/test.html.\", \"html\"]],\n [\"/test.hbs.html\", null]\n ],\n [\n [{ format: \"\" }, null],\n [{ format: \"foo\" }, \"/test.foo.\"]\n ]\n ],\n\n /**\n * Format and path params.\n */\n [\n \"/:test.:format\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n {\n name: \"format\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/route.html\", [\"/route.html\", \"route\", \"html\"]],\n [\"/route\", null],\n [\"/route.html.json\", [\"/route.html.json\", \"route\", \"html.json\"]]\n ],\n [\n [{}, null],\n [{ test: \"route\", format: \"foo\" }, \"/route.foo\"]\n ]\n ],\n [\n \"/:test{.:format}?\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n {\n name: \"format\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/route\", [\"/route\", \"route\", undefined]],\n [\"/route.json\", [\"/route.json\", \"route\", \"json\"]],\n [\"/route.json.html\", [\"/route.json.html\", \"route\", \"json.html\"]]\n ],\n [\n [{ test: \"route\" }, \"/route\"],\n [{ test: \"route\", format: \"\" }, null],\n [{ test: \"route\", format: \"foo\" }, \"/route.foo\"]\n ]\n ],\n [\n \"/:test.:format?\",\n {\n end: false\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n {\n name: \"format\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/route\", [\"/route\", \"route\", undefined]],\n [\"/route.json\", [\"/route.json\", \"route\", \"json\"]],\n [\"/route.json.html\", [\"/route.json.html\", \"route\", \"json.html\"]]\n ],\n [\n [{ test: \"route\" }, \"/route\"],\n [{ test: \"route\", format: undefined }, \"/route\"],\n [{ test: \"route\", format: \"\" }, null],\n [{ test: \"route\", format: \"foo\" }, \"/route.foo\"]\n ]\n ],\n [\n \"/test.:format(.*)z\",\n {\n end: false\n },\n [\n \"/test\",\n {\n name: \"format\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"\",\n pattern: \".*\"\n },\n \"z\"\n ],\n [\n [\"/test.abc\", null],\n [\"/test.z\", [\"/test.z\", \"\"]],\n [\"/test.abcz\", [\"/test.abcz\", \"abc\"]]\n ],\n [\n [{}, null],\n [{ format: \"\" }, \"/test.z\"],\n [{ format: \"foo\" }, \"/test.fooz\"]\n ]\n ],\n\n /**\n * Unnamed params.\n */\n [\n \"/(\\\\d+)\",\n undefined,\n [\n {\n name: 0,\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\\\\d+\"\n }\n ],\n [\n [\"/123\", [\"/123\", \"123\"]],\n [\"/abc\", null],\n [\"/123/abc\", null]\n ],\n [\n [{}, null],\n [{ \"0\": \"123\" }, \"/123\"]\n ]\n ],\n [\n \"/(\\\\d+)\",\n {\n end: false\n },\n [\n {\n name: 0,\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\\\\d+\"\n }\n ],\n [\n [\"/123\", [\"/123\", \"123\"]],\n [\"/abc\", null],\n [\"/123/abc\", [\"/123\", \"123\"]],\n [\"/123/\", [\"/123/\", \"123\"]]\n ],\n [[{ \"0\": \"123\" }, \"/123\"]]\n ],\n [\n \"/(\\\\d+)?\",\n undefined,\n [\n {\n name: 0,\n prefix: \"/\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"\\\\d+\"\n }\n ],\n [\n [\"/\", [\"/\", undefined]],\n [\"/123\", [\"/123\", \"123\"]]\n ],\n [\n [{}, \"\"],\n [{ \"0\": \"123\" }, \"/123\"]\n ]\n ],\n [\n \"/(.*)\",\n undefined,\n [\n {\n name: 0,\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \".*\"\n }\n ],\n [\n [\"/\", [\"/\", \"\"]],\n [\"/route\", [\"/route\", \"route\"]],\n [\"/route/nested\", [\"/route/nested\", \"route/nested\"]]\n ],\n [\n [{ \"0\": \"\" }, \"/\"],\n [{ \"0\": \"123\" }, \"/123\"]\n ]\n ],\n [\n \"/route\\\\(\\\\\\\\(\\\\d+\\\\\\\\)\\\\)\",\n undefined,\n [\n \"/route(\\\\\",\n {\n name: 0,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\\\\d+\\\\\\\\\"\n },\n \")\"\n ],\n [[\"/route(\\\\123\\\\)\", [\"/route(\\\\123\\\\)\", \"123\\\\\"]]],\n []\n ],\n [\n \"{/login}?\",\n undefined,\n [\n {\n name: \"\",\n prefix: \"/login\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"\"\n }\n ],\n [\n [\"/\", [\"/\"]],\n [\"/login\", [\"/login\"]]\n ],\n [\n [null, \"\"],\n [{ \"\": \"\" }, \"/login\"]\n ]\n ],\n [\n \"{/login}\",\n undefined,\n [\n {\n name: \"\",\n prefix: \"/login\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\"\n }\n ],\n [\n [\"/\", null],\n [\"/login\", [\"/login\"]]\n ],\n [[{ \"\": \"\" }, \"/login\"]]\n ],\n [\n \"{/(.*)}\",\n undefined,\n [\n {\n name: 0,\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \".*\"\n }\n ],\n [\n [\"/\", [\"/\", \"\"]],\n [\"/login\", [\"/login\", \"login\"]]\n ],\n [[{ 0: \"test\" }, \"/test\"]]\n ],\n\n /**\n * Regexps.\n */\n [/.*/, undefined, [], [[\"/match/anything\", [\"/match/anything\"]]], []],\n [\n /(.*)/,\n undefined,\n [\n {\n name: 0,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\"\n }\n ],\n [[\"/match/anything\", [\"/match/anything\", \"/match/anything\"]]],\n []\n ],\n [\n /\\/(\\d+)/,\n undefined,\n [\n {\n name: 0,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\"\n }\n ],\n [\n [\"/abc\", null],\n [\"/123\", [\"/123\", \"123\"]]\n ],\n []\n ],\n\n /**\n * Mixed arrays.\n */\n [\n [\"/test\", /\\/(\\d+)/],\n undefined,\n [\n {\n name: 0,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\"\n }\n ],\n [[\"/test\", [\"/test\", undefined]]],\n []\n ],\n [\n [\"/:test(\\\\d+)\", /(.*)/],\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\\\\d+\"\n },\n {\n name: 0,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\"\n }\n ],\n [\n [\"/123\", [\"/123\", \"123\", undefined]],\n [\"/abc\", [\"/abc\", undefined, \"/abc\"]]\n ],\n []\n ],\n\n /**\n * Correct names and indexes.\n */\n [\n [\"/:test\", \"/route/:test\"],\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/test\", [\"/test\", \"test\", undefined]],\n [\"/route/test\", [\"/route/test\", undefined, \"test\"]]\n ],\n []\n ],\n [\n [/^\\/([^\\/]+)$/, /^\\/route\\/([^\\/]+)$/],\n undefined,\n [\n {\n name: 0,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\"\n },\n {\n name: 0,\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\"\n }\n ],\n [\n [\"/test\", [\"/test\", \"test\", undefined]],\n [\"/route/test\", [\"/route/test\", undefined, \"test\"]]\n ],\n []\n ],\n\n /**\n * Ignore non-matching groups in regexps.\n */\n [\n /(?:.*)/,\n undefined,\n [],\n [[\"/anything/you/want\", [\"/anything/you/want\"]]],\n []\n ],\n\n /**\n * Respect escaped characters.\n */\n [\n \"/\\\\(testing\\\\)\",\n undefined,\n [\"/(testing)\"],\n [\n [\"/testing\", null],\n [\"/(testing)\", [\"/(testing)\"]]\n ],\n [[null, \"/(testing)\"]]\n ],\n [\n \"/.\\\\+\\\\*\\\\?\\\\{\\\\}=^!\\\\:$[]|\",\n undefined,\n [\"/.+*?{}=^!:$[]|\"],\n [[\"/.+*?{}=^!:$[]|\", [\"/.+*?{}=^!:$[]|\"]]],\n [[null, \"/.+*?{}=^!:$[]|\"]]\n ],\n [\n \"/test\\\\/:uid(u\\\\d+)?:cid(c\\\\d+)?\",\n undefined,\n [\n \"/test/\",\n {\n name: \"uid\",\n prefix: \"\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"u\\\\d+\"\n },\n {\n name: \"cid\",\n prefix: \"\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"c\\\\d+\"\n }\n ],\n [\n [\"/test\", null],\n [\"/test/\", [\"/test/\", undefined, undefined]],\n [\"/test/u123\", [\"/test/u123\", \"u123\", undefined]],\n [\"/test/c123\", [\"/test/c123\", undefined, \"c123\"]]\n ],\n [\n [{ uid: \"u123\" }, \"/test/u123\"],\n [{ cid: \"c123\" }, \"/test/c123\"],\n [{ cid: \"u123\" }, null]\n ]\n ],\n\n /**\n * Unnamed group prefix.\n */\n [\n \"/{apple-}?icon-:res(\\\\d+).png\",\n undefined,\n [\n \"/\",\n {\n name: \"\",\n prefix: \"apple-\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"\"\n },\n \"icon-\",\n {\n name: \"res\",\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\\\\d+\"\n },\n \".png\"\n ],\n [\n [\"/icon-240.png\", [\"/icon-240.png\", \"240\"]],\n [\"/apple-icon-240.png\", [\"/apple-icon-240.png\", \"240\"]]\n ],\n []\n ],\n\n /**\n * Random examples.\n */\n [\n \"/:foo/:bar\",\n undefined,\n [\n {\n name: \"foo\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n {\n name: \"bar\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [[\"/match/route\", [\"/match/route\", \"match\", \"route\"]]],\n [[{ foo: \"a\", bar: \"b\" }, \"/a/b\"]]\n ],\n [\n \"/:foo\\\\(test\\\\)/bar\",\n undefined,\n [\n {\n name: \"foo\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"(test)/bar\"\n ],\n [],\n []\n ],\n [\n \"/:remote([\\\\w-.]+)/:user([\\\\w-]+)\",\n undefined,\n [\n {\n name: \"remote\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[\\\\w-.]+\"\n },\n {\n name: \"user\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[\\\\w-]+\"\n }\n ],\n [\n [\"/endpoint/user\", [\"/endpoint/user\", \"endpoint\", \"user\"]],\n [\"/endpoint/user-name\", [\"/endpoint/user-name\", \"endpoint\", \"user-name\"]],\n [\"/foo.bar/user-name\", [\"/foo.bar/user-name\", \"foo.bar\", \"user-name\"]]\n ],\n [\n [{ remote: \"foo\", user: \"bar\" }, \"/foo/bar\"],\n [{ remote: \"foo.bar\", user: \"uno\" }, \"/foo.bar/uno\"]\n ]\n ],\n [\n \"/:foo\\\\?\",\n undefined,\n [\n {\n name: \"foo\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"?\"\n ],\n [[\"/route?\", [\"/route?\", \"route\"]]],\n [[{ foo: \"bar\" }, \"/bar?\"]]\n ],\n [\n \"/:foo+baz\",\n undefined,\n [\n {\n name: \"foo\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"+\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"baz\"\n ],\n [\n [\"/foobaz\", [\"/foobaz\", \"foo\"]],\n [\"/foo/barbaz\", [\"/foo/barbaz\", \"foo/bar\"]],\n [\"/baz\", null]\n ],\n [\n [{ foo: \"foo\" }, \"/foobaz\"],\n [{ foo: \"foo/bar\" }, \"/foo%2Fbarbaz\", { encode: encodeURIComponent }],\n [{ foo: [\"foo\", \"bar\"] }, \"/foo/barbaz\"]\n ]\n ],\n [\n \"\\\\/:pre?baz\",\n undefined,\n [\n \"/\",\n {\n name: \"pre\",\n prefix: \"\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"baz\"\n ],\n [\n [\"/foobaz\", [\"/foobaz\", \"foo\"]],\n [\"/baz\", [\"/baz\", undefined]]\n ],\n [\n [{}, \"/baz\"],\n [{ pre: \"foo\" }, \"/foobaz\"]\n ]\n ],\n [\n \"/:foo\\\\(:bar?\\\\)\",\n undefined,\n [\n {\n name: \"foo\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"(\",\n {\n name: \"bar\",\n prefix: \"\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \")\"\n ],\n [\n [\"/hello(world)\", [\"/hello(world)\", \"hello\", \"world\"]],\n [\"/hello()\", [\"/hello()\", \"hello\", undefined]]\n ],\n [\n [{ foo: \"hello\", bar: \"world\" }, \"/hello(world)\"],\n [{ foo: \"hello\" }, \"/hello()\"]\n ]\n ],\n [\n \"/:postType(video|audio|text)(\\\\+.+)?\",\n undefined,\n [\n {\n name: \"postType\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"video|audio|text\"\n },\n {\n name: 0,\n prefix: \"\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"\\\\+.+\"\n }\n ],\n [\n [\"/video\", [\"/video\", \"video\", undefined]],\n [\"/video+test\", [\"/video+test\", \"video\", \"+test\"]],\n [\"/video+\", null]\n ],\n [\n [{ postType: \"video\" }, \"/video\"],\n [{ postType: \"random\" }, null]\n ]\n ],\n [\n \"/:foo?/:bar?-ext\",\n undefined,\n [\n {\n name: \"foo\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n {\n name: \"bar\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"-ext\"\n ],\n [\n [\"/-ext\", null],\n [\"-ext\", [\"-ext\", undefined, undefined]],\n [\"/foo-ext\", [\"/foo-ext\", \"foo\", undefined]],\n [\"/foo/bar-ext\", [\"/foo/bar-ext\", \"foo\", \"bar\"]],\n [\"/foo/-ext\", null]\n ],\n [\n [{}, \"-ext\"],\n [{ foo: \"foo\" }, \"/foo-ext\"],\n [{ bar: \"bar\" }, \"/bar-ext\"],\n [{ foo: \"foo\", bar: \"bar\" }, \"/foo/bar-ext\"]\n ]\n ],\n [\n \"/:required/:optional?-ext\",\n undefined,\n [\n {\n name: \"required\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n {\n name: \"optional\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"-ext\"\n ],\n [\n [\"/foo-ext\", [\"/foo-ext\", \"foo\", undefined]],\n [\"/foo/bar-ext\", [\"/foo/bar-ext\", \"foo\", \"bar\"]],\n [\"/foo/-ext\", null]\n ],\n [[{ required: \"foo\" }, \"/foo-ext\"]]\n ],\n\n /**\n * Unicode characters.\n */\n [\n \"/:foo\",\n undefined,\n [\n {\n name: \"foo\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [[\"/café\", [\"/café\", \"café\"]]],\n [\n [{ foo: \"café\" }, \"/café\"],\n [{ foo: \"café\" }, \"/caf%C3%A9\", { encode: encodeURIComponent }]\n ]\n ],\n [\"/café\", undefined, [\"/café\"], [[\"/café\", [\"/café\"]]], [[null, \"/café\"]]],\n [\n \"/café\",\n { encode: encodeURI },\n [\"/café\"],\n [[\"/caf%C3%A9\", [\"/caf%C3%A9\"]]],\n [[null, \"/café\"]]\n ],\n [\n \"packages/\",\n undefined,\n [\"packages/\"],\n [\n [\"packages\", null],\n [\"packages/\", [\"packages/\"]]\n ],\n [[null, \"packages/\"]]\n ],\n\n /**\n * Hostnames.\n */\n [\n \":domain.com\",\n {\n delimiter: \".\"\n },\n [\n {\n name: \"domain\",\n prefix: \"\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\.]+?\"\n },\n \".com\"\n ],\n [\n [\"example.com\", [\"example.com\", \"example\"]],\n [\"github.com\", [\"github.com\", \"github\"]]\n ],\n [\n [{ domain: \"example\" }, \"example.com\"],\n [{ domain: \"github\" }, \"github.com\"]\n ]\n ],\n [\n \"mail.:domain.com\",\n {\n delimiter: \".\"\n },\n [\n \"mail\",\n {\n name: \"domain\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\.]+?\"\n },\n \".com\"\n ],\n [\n [\"mail.example.com\", [\"mail.example.com\", \"example\"]],\n [\"mail.github.com\", [\"mail.github.com\", \"github\"]]\n ],\n [\n [{ domain: \"example\" }, \"mail.example.com\"],\n [{ domain: \"github\" }, \"mail.github.com\"]\n ]\n ],\n [\n \"example.:ext\",\n {},\n [\n \"example\",\n {\n name: \"ext\",\n prefix: \".\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"example.com\", [\"example.com\", \"com\"]],\n [\"example.org\", [\"example.org\", \"org\"]]\n ],\n [\n [{ ext: \"com\" }, \"example.com\"],\n [{ ext: \"org\" }, \"example.org\"]\n ]\n ],\n [\n \"this is\",\n {\n delimiter: \" \",\n end: false\n },\n [\"this is\"],\n [\n [\"this is a test\", [\"this is\"]],\n [\"this isn't\", null]\n ],\n [[null, \"this is\"]]\n ],\n\n /**\n * Ends with.\n */\n [\n \"/test\",\n {\n endsWith: \"?\"\n },\n [\"/test\"],\n [\n [\"/test\", [\"/test\"]],\n [\"/test?query=string\", [\"/test\"]],\n [\"/test/?query=string\", [\"/test/\"]],\n [\"/testx\", null]\n ],\n [[null, \"/test\"]]\n ],\n [\n \"/test\",\n {\n endsWith: \"?\",\n strict: true\n },\n [\"/test\"],\n [\n [\"/test?query=string\", [\"/test\"]],\n [\"/test/?query=string\", null]\n ],\n [[null, \"/test\"]]\n ],\n\n /**\n * Custom prefixes.\n */\n [\n \"{$:foo}{$:bar}?\",\n {},\n [\n {\n name: \"foo\",\n pattern: \"[^\\\\/#\\\\?]+?\",\n prefix: \"$\",\n suffix: \"\",\n modifier: \"\"\n },\n {\n name: \"bar\",\n pattern: \"[^\\\\/#\\\\?]+?\",\n prefix: \"$\",\n suffix: \"\",\n modifier: \"?\"\n }\n ],\n [\n [\"$x\", [\"$x\", \"x\", undefined]],\n [\"$x$y\", [\"$x$y\", \"x\", \"y\"]]\n ],\n [\n [{ foo: \"foo\" }, \"$foo\"],\n [{ foo: \"foo\", bar: \"bar\" }, \"$foo$bar\"]\n ]\n ],\n [\n \"name/:attr1?{-:attr2}?{-:attr3}?\",\n {},\n [\n \"name\",\n {\n name: \"attr1\",\n pattern: \"[^\\\\/#\\\\?]+?\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"?\"\n },\n {\n name: \"attr2\",\n pattern: \"[^\\\\/#\\\\?]+?\",\n prefix: \"-\",\n suffix: \"\",\n modifier: \"?\"\n },\n {\n name: \"attr3\",\n pattern: \"[^\\\\/#\\\\?]+?\",\n prefix: \"-\",\n suffix: \"\",\n modifier: \"?\"\n }\n ],\n [\n [\"name/test\", [\"name/test\", \"test\", undefined, undefined]],\n [\"name/1\", [\"name/1\", \"1\", undefined, undefined]],\n [\"name/1-2\", [\"name/1-2\", \"1\", \"2\", undefined]],\n [\"name/1-2-3\", [\"name/1-2-3\", \"1\", \"2\", \"3\"]],\n [\"name/foo-bar/route\", null],\n [\"name/test/route\", null]\n ],\n [\n [{}, \"name\"],\n [{ attr1: \"test\" }, \"name/test\"],\n [{ attr2: \"attr\" }, \"name-attr\"]\n ]\n ],\n\n /**\n * Case-sensitive compile tokensToFunction params.\n */\n [\n \"/:test(abc)\",\n {\n sensitive: true\n },\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"abc\"\n }\n ],\n [\n [\"/abc\", [\"/abc\", \"abc\"]],\n [\"/ABC\", null]\n ],\n [\n [{ test: \"abc\" }, \"/abc\"],\n [{ test: \"ABC\" }, null]\n ]\n ],\n [\n \"/:test(abc)\",\n {},\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"abc\"\n }\n ],\n [\n [\"/abc\", [\"/abc\", \"abc\"]],\n [\"/ABC\", [\"/ABC\", \"ABC\"]]\n ],\n [\n [{ test: \"abc\" }, \"/abc\"],\n [{ test: \"ABC\" }, \"/ABC\"]\n ]\n ],\n\n /**\n * Nested parentheses.\n */\n [\n \"/:test(\\\\d+(?:\\\\.\\\\d+)?)\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"\\\\d+(?:\\\\.\\\\d+)?\"\n }\n ],\n [\n [\"/123\", [\"/123\", \"123\"]],\n [\"/abc\", null],\n [\"/123/abc\", null],\n [\"/123.123\", [\"/123.123\", \"123.123\"]],\n [\"/123.abc\", null]\n ],\n [\n [{ test: 123 }, \"/123\"],\n [{ test: 123.123 }, \"/123.123\"],\n [{ test: \"abc\" }, null],\n [{ test: \"123\" }, \"/123\"],\n [{ test: \"123.123\" }, \"/123.123\"],\n [{ test: \"123.abc\" }, null]\n ]\n ],\n [\n \"/:test((?!login)[^/]+)\",\n undefined,\n [\n {\n name: \"test\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"(?!login)[^/]+\"\n }\n ],\n [\n [\"/route\", [\"/route\", \"route\"]],\n [\"/login\", null]\n ],\n [\n [{ test: \"route\" }, \"/route\"],\n [{ test: \"login\" }, null]\n ]\n ],\n\n /**\n * https://github.com/pillarjs/path-to-regexp/issues/206\n */\n [\n \"/user(s)?/:user\",\n undefined,\n [\n \"/user\",\n {\n name: 0,\n prefix: \"\",\n suffix: \"\",\n modifier: \"?\",\n pattern: \"s\"\n },\n {\n name: \"user\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/user/123\", [\"/user/123\", undefined, \"123\"]],\n [\"/users/123\", [\"/users/123\", \"s\", \"123\"]]\n ],\n [[{ user: \"123\" }, \"/user/123\"]]\n ],\n\n /**\n * https://github.com/pillarjs/path-to-regexp/issues/209\n */\n [\n \"/whatever/:foo\\\\?query=str\",\n undefined,\n [\n \"/whatever\",\n {\n name: \"foo\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n },\n \"?query=str\"\n ],\n [[\"/whatever/123?query=str\", [\"/whatever/123?query=str\", \"123\"]]],\n [[{ foo: \"123\" }, \"/whatever/123?query=str\"]]\n ],\n [\n \"/whatever/:foo\",\n {\n end: false\n },\n [\n \"/whatever\",\n {\n name: \"foo\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n }\n ],\n [\n [\"/whatever/123\", [\"/whatever/123\", \"123\"]],\n [\"/whatever/123/path\", [\"/whatever/123\", \"123\"]],\n [\"/whatever/123#fragment\", [\"/whatever/123\", \"123\"]],\n [\"/whatever/123?query=str\", [\"/whatever/123\", \"123\"]]\n ],\n [\n [{ foo: \"123\" }, \"/whatever/123\"],\n [{ foo: \"#\" }, null]\n ]\n ]\n];\n\n/**\n * Dynamically generate the entire test suite.\n */\ndescribe(\"path-to-regexp\", function() {\n const TEST_PATH = \"/user/:id\";\n\n const TEST_PARAM = {\n name: \"id\",\n prefix: \"/\",\n suffix: \"\",\n modifier: \"\",\n pattern: \"[^\\\\/#\\\\?]+?\"\n };\n\n describe(\"arguments\", function() {\n it(\"should work without different call combinations\", function() {\n pathToRegexp.pathToRegexp(\"/test\");\n pathToRegexp.pathToRegexp(\"/test\", []);\n pathToRegexp.pathToRegexp(\"/test\", undefined, {});\n\n pathToRegexp.pathToRegexp(/^\\/test/);\n pathToRegexp.pathToRegexp(/^\\/test/, []);\n pathToRegexp.pathToRegexp(/^\\/test/, undefined, {});\n\n pathToRegexp.pathToRegexp([\"/a\", \"/b\"]);\n pathToRegexp.pathToRegexp([\"/a\", \"/b\"], []);\n pathToRegexp.pathToRegexp([\"/a\", \"/b\"], undefined, {});\n });\n\n it(\"should accept an array of keys as the second argument\", function() {\n const keys: pathToRegexp.Key[] = [];\n const re = pathToRegexp.pathToRegexp(TEST_PATH, keys, { end: false });\n\n expect(keys).toEqual([TEST_PARAM]);\n expect(exec(re, \"/user/123/show\")).toEqual([\"/user/123\", \"123\"]);\n });\n\n it(\"should throw on non-capturing pattern\", function() {\n expect(function() {\n pathToRegexp.pathToRegexp(\"/:foo(?:\\\\d+(\\\\.\\\\d+)?)\");\n }).toThrow(new TypeError('Pattern cannot start with \"?\" at 6'));\n });\n\n it(\"should throw on nested capturing group\", function() {\n expect(function() {\n pathToRegexp.pathToRegexp(\"/:foo(\\\\d+(\\\\.\\\\d+)?)\");\n }).toThrow(new TypeError(\"Capturing groups are not allowed at 9\"));\n });\n\n it(\"should throw on unbalanced pattern\", function() {\n expect(function() {\n pathToRegexp.pathToRegexp(\"/:foo(abc\");\n }).toThrow(new TypeError(\"Unbalanced pattern at 5\"));\n });\n\n it(\"should throw on missing pattern\", function() {\n expect(function() {\n pathToRegexp.pathToRegexp(\"/:foo()\");\n }).toThrow(new TypeError(\"Missing pattern at 5\"));\n });\n\n it(\"should throw on missing name\", function() {\n expect(function() {\n pathToRegexp.pathToRegexp(\"/:(test)\");\n }).toThrow(new TypeError(\"Missing parameter name at 1\"));\n });\n\n it(\"should throw on nested groups\", function() {\n expect(function() {\n pathToRegexp.pathToRegexp(\"/{a{b:foo}}\");\n }).toThrow(new TypeError(\"Unexpected OPEN at 3, expected CLOSE\"));\n });\n\n it(\"should throw on misplaced modifier\", function() {\n expect(function() {\n pathToRegexp.pathToRegexp(\"/foo?\");\n }).toThrow(new TypeError(\"Unexpected MODIFIER at 4, expected END\"));\n });\n });\n\n describe(\"tokens\", function() {\n const tokens = pathToRegexp.parse(TEST_PATH);\n\n it(\"should expose method to compile tokens to regexp\", function() {\n const re = pathToRegexp.tokensToRegexp(tokens);\n\n expect(exec(re, \"/user/123\")).toEqual([\"/user/123\", \"123\"]);\n });\n\n it(\"should expose method to compile tokens to a path function\", function() {\n const fn = pathToRegexp.tokensToFunction(tokens);\n\n expect(fn({ id: 123 })).toEqual(\"/user/123\");\n });\n });\n\n describe(\"rules\", function() {\n TESTS.forEach(function(test) {\n const [path, opts, tokens, matchCases, compileCases] = test;\n\n describe(util.inspect(path), function() {\n const keys: pathToRegexp.Key[] = [];\n const re = pathToRegexp.pathToRegexp(path, keys, opts);\n\n // Parsing and compiling is only supported with string input.\n if (typeof path === \"string\") {\n it(\"should parse\", function() {\n expect(pathToRegexp.parse(path, opts)).toEqual(tokens);\n });\n\n describe(\"compile\", function() {\n compileCases.forEach(function(io) {\n const [params, result, options] = io;\n const toPath = pathToRegexp.compile(path, {\n ...opts,\n ...options\n });\n\n if (result !== null) {\n it(\"should compile using \" + util.inspect(params), function() {\n expect(toPath(params)).toEqual(result);\n });\n } else {\n it(\n \"should not compile using \" + util.inspect(params),\n function() {\n expect(function() {\n toPath(params);\n }).toThrow(TypeError);\n }\n );\n }\n });\n });\n } else {\n it(\"should parse keys\", function() {\n expect(keys).toEqual(\n tokens.filter(function(token) {\n return typeof token !== \"string\";\n })\n );\n });\n }\n\n describe(\n \"match\" + (opts ? \" using \" + util.inspect(opts) : \"\"),\n function() {\n matchCases.forEach(function(io) {\n const [pathname, matches, params, options] = io;\n const message = `should ${\n matches ? \"\" : \"not \"\n }match ${util.inspect(pathname)}`;\n\n it(message, function() {\n expect(exec(re, pathname)).toEqual(matches);\n });\n\n if (typeof path === \"string\" && params !== undefined) {\n const match = pathToRegexp.match(path, options);\n\n it(message + \" params\", function() {\n expect(match(pathname)).toEqual(params);\n });\n }\n });\n }\n );\n });\n });\n });\n\n describe(\"compile errors\", function() {\n it(\"should throw when a required param is undefined\", function() {\n const toPath = pathToRegexp.compile(\"/a/:b/c\");\n\n expect(function() {\n toPath();\n }).toThrow(new TypeError('Expected \"b\" to be a string'));\n });\n\n it(\"should throw when it does not match the pattern\", function() {\n const toPath = pathToRegexp.compile(\"/:foo(\\\\d+)\");\n\n expect(function() {\n toPath({ foo: \"abc\" });\n }).toThrow(\n new TypeError('Expected \"foo\" to match \"\\\\d+\", but got \"abc\"')\n );\n });\n\n it(\"should throw when expecting a repeated value\", function() {\n const toPath = pathToRegexp.compile(\"/:foo+\");\n\n expect(function() {\n toPath({ foo: [] });\n }).toThrow(new TypeError('Expected \"foo\" to not be empty'));\n });\n\n it(\"should throw when not expecting a repeated value\", function() {\n const toPath = pathToRegexp.compile(\"/:foo\");\n\n expect(function() {\n toPath({ foo: [] });\n }).toThrow(\n new TypeError('Expected \"foo\" to not repeat, but got an array')\n );\n });\n\n it(\"should throw when repeated value does not match\", function() {\n const toPath = pathToRegexp.compile(\"/:foo(\\\\d+)+\");\n\n expect(function() {\n toPath({ foo: [1, 2, 3, \"a\"] });\n }).toThrow(\n new TypeError('Expected all \"foo\" to match \"\\\\d+\", but got \"a\"')\n );\n });\n });\n});\n\n/**\n * Execute a regular expression and return a flat array for comparison.\n *\n * @param {RegExp} re\n * @param {String} str\n * @return {Array}\n */\nfunction exec(re: RegExp, str: string) {\n const match = re.exec(str);\n\n return match && Array.prototype.slice.call(match);\n}\n"]} \ No newline at end of file diff --git a/packages/next/src/compiled/path-to-regexp/package.json b/packages/next/src/compiled/path-to-regexp/package.json new file mode 100644 index 0000000000000..c5376135ab189 --- /dev/null +++ b/packages/next/src/compiled/path-to-regexp/package.json @@ -0,0 +1,86 @@ +{ + "name": "path-to-regexp", + "description": "Express style path to RegExp utility", + "version": "6.1.0", + "main": "dist/index.js", + "typings": "dist/index.d.ts", + "module": "dist.es2015/index.js", + "sideEffects": false, + "files": [ + "dist/", + "dist.es2015/" + ], + "scripts": { + "prettier": "prettier --write", + "lint": "tslint \"src/**/*\" --project tsconfig.json", + "format": "npm run prettier -- \"{.,src/**}/*.{js,jsx,ts,tsx,json,md,yml,yaml}\"", + "build": "rimraf dist/ dist.es2015/ && tsc && tsc -P tsconfig.es2015.json", + "specs": "jest --coverage", + "test": "npm run build && npm run lint && npm run specs && npm run size", + "size": "size-limit", + "prepare": "npm run build" + }, + "keywords": [ + "express", + "regexp", + "route", + "routing" + ], + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/pillarjs/path-to-regexp.git" + }, + "size-limit": [ + { + "path": "dist/index.js", + "limit": "2 kB" + } + ], + "jest": { + "roots": [ + "/src/" + ], + "transform": { + "\\.tsx?$": "ts-jest" + }, + "testRegex": "(/__tests__/.*|\\.(test|spec))\\.(tsx?|jsx?)$", + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "jsx", + "json", + "node" + ] + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.{js,jsx,ts,tsx,json,md,yml,yaml}": [ + "npm run prettier", + "git add" + ] + }, + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "@size-limit/preset-small-lib": "^2.1.6", + "@types/jest": "^24.0.22", + "@types/node": "^12.12.7", + "husky": "^3.0.9", + "jest": "^24.9.0", + "lint-staged": "^9.4.2", + "prettier": "^1.19.1", + "rimraf": "^3.0.0", + "ts-jest": "^24.1.0", + "tslint": "^5.20.1", + "tslint-config-prettier": "^1.18.0", + "tslint-config-standard": "^9.0.0", + "typescript": "^3.7.2" + } +} diff --git a/packages/next/taskfile.js b/packages/next/taskfile.js index fb7fcef9bc584..a3dd22d83971a 100644 --- a/packages/next/taskfile.js +++ b/packages/next/taskfile.js @@ -2128,6 +2128,9 @@ export async function ncc_ws(task, opts) { externals['path-to-regexp'] = 'next/dist/compiled/path-to-regexp' export async function path_to_regexp(task, opts) { + await task + .source(relative(__dirname, require.resolve('path-to-regexp/package.json'))) + .target('src/compiled/path-to-regexp') await task .source( join( @@ -2135,7 +2138,7 @@ export async function path_to_regexp(task, opts) { '*.{js,map}' ) ) - .target('dist/compiled/path-to-regexp') + .target('src/compiled/path-to-regexp') } // eslint-disable-next-line camelcase