Commit 9e7caef3 authored by ChanHaeng Lee's avatar ChanHaeng Lee
Browse files

Fix regex to be more clear

parent 8fff0fbd
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1889,10 +1889,11 @@ export class ContextImpl<TContextData> implements Context<TContextData> {
      };
    }

    const collectionRegex = /^(orderedC|c)ollection:(.*)$/;
    const collectionTypes = ["collection", "orderedCollection"] as const;
    const collectionRegex = new RegExp(`^(${collectionTypes.join("|")}):(.*)$`);
    const match = route.name.match(collectionRegex) as null | [
      unknown,
      "collection" | "orderedCollection",
      typeof collectionTypes[number],
      string,
    ];
    if (match !== null) {