Skip to content

Commit

Permalink
revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yyanwang committed Dec 24, 2024
1 parent 10dec6c commit 4bcbdd5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/cmf/src/matchPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Beware! Do not modify. Forked from react-router V4
* Will be available as a dependency
*/
import { pathToRegexp } from 'path-to-regexp';
import pathToRegexp from 'path-to-regexp';

const patternCache = {};
const cacheLimit = 10000;
Expand All @@ -14,8 +14,9 @@ const compilePath = (pattern, options) => {

if (cache[pattern]) return cache[pattern];

const { regexp, keys } = pathToRegexp(pattern, options);
const compiledPattern = { re: regexp, keys };
const keys = [];
const re = pathToRegexp(pattern, keys, options);
const compiledPattern = { re, keys };

if (cacheCount < cacheLimit) {
cache[pattern] = compiledPattern;
Expand Down

0 comments on commit 4bcbdd5

Please sign in to comment.