From 946d173ca620381f62dcaa1f6e1f64af597416a9 Mon Sep 17 00:00:00 2001 From: SlothScript <106759481+SlothScript@users.noreply.github.com> Date: Tue, 15 Apr 2025 18:15:51 -0500 Subject: [PATCH] Show problematic url --- src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index c178797..878fc2f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -145,12 +145,12 @@ function* lexer(str: string): Generator { } if (pos) { - throw new TypeError(`Unterminated quote at ${pos}: ${DEBUG_URL}`); + throw new TypeError(`Unterminated quote at ${pos}: ${str}; Visit ${DEBUG_URL} for more information.`); } } if (!value) { - throw new TypeError(`Missing parameter name at ${i}: ${DEBUG_URL}`); + throw new TypeError(`Missing parameter name at ${i}: ${str}; Visit ${DEBUG_URL} for more information.`); } return value; @@ -203,7 +203,7 @@ class Iter { if (value !== undefined) return value; const { type: nextType, index } = this.peek(); throw new TypeError( - `Unexpected ${nextType} at ${index}, expected ${type}: ${DEBUG_URL}`, + `Unexpected ${nextType} at ${index}, expected ${type}: ${str}; Visit ${DEBUG_URL} for more information.`, ); } @@ -575,7 +575,7 @@ function toRegExp(tokens: Flattened[], delimiter: string, keys: Keys) { if (token.type === "param" || token.type === "wildcard") { if (!isSafeSegmentParam && !backtrack) { - throw new TypeError(`Missing text after "${token.name}": ${DEBUG_URL}`); + throw new TypeError(`Missing text after "${token.name}": ${str}; Visit ${DEBUG_URL} for more information.`); } if (token.type === "param") {