Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 51dbd45

Browse files
Remove s flag from regexp
1 parent df39d6c commit 51dbd45

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ export function pathToRegexp(
497497
} = options;
498498
const keys: Keys = [];
499499
const sources: string[] = [];
500-
const flags = sensitive ? "s" : "is";
500+
const flags = sensitive ? "" : "i";
501501
const paths = Array.isArray(path) ? path : [path];
502502
const items = paths.map((path) =>
503503
path instanceof TokenData ? path : parse(path, options),
@@ -575,7 +575,7 @@ function sequenceToRegExp(tokens: Flattened[], delimiter: string, keys: Keys) {
575575
if (token.type === "param") {
576576
result += `(${negate(delimiter, isSafeSegmentParam ? "" : backtrack)}+)`;
577577
} else {
578-
result += `(.+)`;
578+
result += `([\\s\\S]+)`;
579579
}
580580

581581
keys.push(token);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /