getAllCookies = (regex) => {
    const allCookies = document.cookie.split(/;\s*/);

    /**
     * @type {string[]}
     */
    const cookieNames = [];

    /**
     * Save only the cookie names
     */
    for (const cookie of allCookies) {
        let name = cookie.split('=')[0];

        if (regex) {
            safeRun(() => {
                regex.test(name) && cookieNames.push(name);
            });
        } else {
            cookieNames.push(name);
        }
    }

    return cookieNames;
}
Returns array with all the cookie names
@param {RegExp} regex
@returns {string[]}