UNPKG

react-photoswipe-gallery

Version:
12 lines (10 loc) 285 B
function hashToObject(hash: string): Record<string, string> { return hash.split('&').reduce((acc, keyValue) => { const [key, value] = keyValue.split('=') if (key) { acc[key] = value } return acc }, {} as Record<string, string>) } export default hashToObject