Skip to content

Commit

Permalink
Remove s flag from regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Sep 23, 2024
1 parent df39d6c commit 51dbd45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ export function pathToRegexp(
} = options;
const keys: Keys = [];
const sources: string[] = [];
const flags = sensitive ? "s" : "is";
const flags = sensitive ? "" : "i";
const paths = Array.isArray(path) ? path : [path];
const items = paths.map((path) =>
path instanceof TokenData ? path : parse(path, options),
Expand Down Expand Up @@ -575,7 +575,7 @@ function sequenceToRegExp(tokens: Flattened[], delimiter: string, keys: Keys) {
if (token.type === "param") {
result += `(${negate(delimiter, isSafeSegmentParam ? "" : backtrack)}+)`;
} else {
result += `(.+)`;
result += `([\\s\\S]+)`;
}

keys.push(token);
Expand Down

0 comments on commit 51dbd45

Please sign in to comment.