brainfock
Version:
Brainfock business management & CMS software.
23 lines (18 loc) • 421 B
JavaScript
import { POP } from './Actions'
import parsePath from './parsePath'
function createLocation(path='/', state=null, action=POP, key=null) {
if (typeof path === 'string')
path = parsePath(path)
const pathname = path.pathname || '/'
const search = path.search || ''
const hash = path.hash || ''
return {
pathname,
search,
hash,
state,
action,
key
}
}
export default createLocation