eraseCookies = (cookies, path, domain) => {
    let allCookies = [];

    /**
     * Add cookie to allCookies array if it exists
     * @param {string | RegExp} cookieName
     */
    const addCookieIfExists = (cookieName) => {
        if (isString(cookieName)) {
            let name = getSingleCookie(cookieName);
            name !== '' && allCookies.push(name);
        } else {
            allCookies.push(...getAllCookies(cookieName));
        }
    };

    if (isArray(cookies)) {
        for (let cookie of cookies) {
            addCookieIfExists(cookie);
        }
    } else {
        addCookieIfExists(cookies);
    }

    eraseCookiesHelper(allCookies, path, domain);
}
Erase cookies API
@param {(string|RegExp|(string|RegExp)[])} cookies
@param {string} [path]
@param {string} [domain]