findMatchingCookies = (allCookies, cookieName) => {
    if (cookieName instanceof RegExp) {
        return allCookies.filter(cookie => cookieName.test(cookie));
    } else {
        const cookieIndex = indexOf(allCookies, cookieName);
        return cookieIndex > -1
            ? [allCookies[cookieIndex]]
            : [];
    }
}
@param {string[]} allCookies
@param {string} cookieName