index.js
function parsePath(req) {
  // get path if preprocessed or otherwise separate path from query string
  const path = req.path || (req.url && req.url.split('?')[0]) || '';
  // ignore start and end slashes, and split the path
  return path.replace(/^\/|\/$/g, '').split('/');
}
function parsePath(req) {
  // get path if preprocessed or otherwise separate path from query string
  const path = req.path || (req.url && req.url.split('?')[0]) || '';
  // ignore start and end slashes, and split the path
  return path.replace(/^\/|\/$/g, '').split('/');
}
function parsePath ( req ) { // get path if preprocessed or otherwise separate path from query string const path = req . path || ( req . url && req . url . split ( '?' ) [ 0 ] ) || '' ; // ignore start and end slashes, and split the path return path . replace ( / ^\/|\/$ / g , '' ) . split ( '/' ) ; }
Parse URL path to an array of its components.
@private
Parse URL path to an array of its components .