Skip to content

Commit

Permalink
Split using a string
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Jul 25, 2024
1 parent 341f873 commit 0d20b15
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,7 @@ export function $match<P extends ParamData>(
const decoders = re.keys.map((key) => {
if (decode && (key.modifier === "+" || key.modifier === "*")) {
const { prefix = "", suffix = "", separator = suffix + prefix } = key;
const re = new RegExp(escape(separator), "g");
return (value: string) => value.split(re).map(decode);
return (value: string) => value.split(separator).map(decode);
}

return decode || NOOP_VALUE;
Expand Down

0 comments on commit 0d20b15

Please sign in to comment.