Skip to content

Commit 51dbd45

Browse files
committed
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

Diff for: src/index.ts

+2-2
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)