/**
 * extracts hash parameters
 * @returns {Object<string>}
 */
export function getURLHash() {
    const result = {};

    if (window === undefined) {
        return result;
    }

    const location = window.location;

    const hash = location.hash;

    const hashRegEx = /([a-zA-Z0-9\-\_]+)\=([a-zA-Z0-9\-\_]+)/g;

    let match;
    while ((match = hashRegEx.exec(hash)) !== null) {
        const variableName = match[1];
        const value = match[2];

        result[variableName] = value;
    }

    return result;
}
