File: /var/www/zaklada/html/node_modules/history/es6/parsePath.js
'use strict';
import warning from 'warning';
import extractPath from './extractPath';
function parsePath(path) {
  var pathname = extractPath(path);
  var search = '';
  var hash = '';
  process.env.NODE_ENV !== 'production' ? warning(path === pathname, 'A path must be pathname + search + hash only, not a fully qualified URL like "%s"', path) : undefined;
  var hashIndex = pathname.indexOf('#');
  if (hashIndex !== -1) {
    hash = pathname.substring(hashIndex);
    pathname = pathname.substring(0, hashIndex);
  }
  var searchIndex = pathname.indexOf('?');
  if (searchIndex !== -1) {
    search = pathname.substring(searchIndex);
    pathname = pathname.substring(0, searchIndex);
  }
  if (pathname === '') pathname = '/';
  return {
    pathname: pathname,
    search: search,
    hash: hash
  };
}
export default parsePath;