Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
recognize(path: string): RecognizedRoute[] | void {
let states = [this.rootState];
let queryParams = {};
let isSlashDropped = false;
let normalizedPath = path;
let queryStart = normalizedPath.indexOf('?');
if (queryStart !== -1) {
let queryString = normalizedPath.substr(queryStart + 1, normalizedPath.length);
normalizedPath = normalizedPath.substr(0, queryStart);
queryParams = parseQueryString(queryString);
}
normalizedPath = decodeURI(normalizedPath);
if (normalizedPath.charAt(0) !== '/') {
normalizedPath = '/' + normalizedPath;
}
let pathLen = normalizedPath.length;
if (pathLen > 1 && normalizedPath.charAt(pathLen - 1) === '/') {
normalizedPath = normalizedPath.substr(0, pathLen - 1);
isSlashDropped = true;
}
for (let i = 0, l = normalizedPath.length; i < l; i++) {
states = recognizeChar(states, normalizedPath.charAt(i));
RouteRecognizer.prototype.recognize = function recognize(path) {
var states = [this.rootState];
var queryParams = {};
var isSlashDropped = false;
var normalizedPath = path;
var queryStart = normalizedPath.indexOf('?');
if (queryStart !== -1) {
var queryString = normalizedPath.substr(queryStart + 1, normalizedPath.length);
normalizedPath = normalizedPath.substr(0, queryStart);
queryParams = parseQueryString(queryString);
}
normalizedPath = decodeURI(normalizedPath);
if (normalizedPath.charAt(0) !== '/') {
normalizedPath = '/' + normalizedPath;
}
var pathLen = normalizedPath.length;
if (pathLen > 1 && normalizedPath.charAt(pathLen - 1) === '/') {
normalizedPath = normalizedPath.substr(0, pathLen - 1);
isSlashDropped = true;
}
for (var i = 0, l = normalizedPath.length; i < l; i++) {
states = recognizeChar(states, normalizedPath.charAt(i));
recognize(path: string): RecognizedRoute[] | void {
let states = [this.rootState];
let queryParams = {};
let isSlashDropped = false;
let normalizedPath = path;
let queryStart = normalizedPath.indexOf('?');
if (queryStart !== -1) {
let queryString = normalizedPath.substr(queryStart + 1, normalizedPath.length);
normalizedPath = normalizedPath.substr(0, queryStart);
queryParams = parseQueryString(queryString);
}
normalizedPath = decodeURI(normalizedPath);
if (normalizedPath.charAt(0) !== '/') {
normalizedPath = '/' + normalizedPath;
}
let pathLen = normalizedPath.length;
if (pathLen > 1 && normalizedPath.charAt(pathLen - 1) === '/') {
normalizedPath = normalizedPath.substr(0, pathLen - 1);
isSlashDropped = true;
}
for (let i = 0, l = normalizedPath.length; i < l; i++) {
states = recognizeChar(states, normalizedPath.charAt(i));
recognize(path) {
let states = [this.rootState];
let queryParams = {};
let isSlashDropped = false;
let normalizedPath = path;
let queryStart = normalizedPath.indexOf('?');
if (queryStart !== -1) {
let queryString = normalizedPath.substr(queryStart + 1, normalizedPath.length);
normalizedPath = normalizedPath.substr(0, queryStart);
queryParams = parseQueryString(queryString);
}
normalizedPath = decodeURI(normalizedPath);
if (normalizedPath.charAt(0) !== '/') {
normalizedPath = '/' + normalizedPath;
}
let pathLen = normalizedPath.length;
if (pathLen > 1 && normalizedPath.charAt(pathLen - 1) === '/') {
normalizedPath = normalizedPath.substr(0, pathLen - 1);
isSlashDropped = true;
}
for (let i = 0, l = normalizedPath.length; i < l; i++) {
states = recognizeChar(states, normalizedPath.charAt(i));