Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const matchesRoutingTable = Object.keys(manifest.routes).some(route => {
const config = manifest.routes[route];
if (config['match']) {
const matcher = new UrlMatcher(route, config as UrlConfig, this.worker.adapter.scope);
return matcher.matches(req.url);
} else {
const oldConfig = config as RouteConfig;
const matchesPath = oldConfig.prefix
? path.indexOf(route) === 0
: path === route;
const matchesPathAndExtension = matchesPath &&
(!oldConfig.onlyWithoutExtension || !this.hasExtension(path));
return matchesPathAndExtension;
}
});
if (matchesRoutingTable) {