import * as queryString from 'query-string' ; import { getHistory } from './storage' ; export default function ( history = getHistory ( ) ) { let search = history ?. location ?. search ; if ( ! search && typeof window !== 'undefined' ) { search = window . location . search ; } return queryString . parse ( search ) ; }