google-trends-api-client
Version:
An fully typed and easy to use client for the google trends api.
18 lines • 764 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCookiesFromCookieCacheIfPossible = void 0;
const common_1 = require("./common");
const getCookiesFromCookieCacheIfPossible = async ({ cookieCache, }) => {
// if no cache, not possible
if (!cookieCache)
return null;
// lookup the values from the cache
const cookiesSerialized = await cookieCache.get(common_1.COOKIES_CACHE_COOKIES_LIST_KEY);
if (!cookiesSerialized)
return null;
// deserialize the cookies, if they exist
const cookies = JSON.parse(cookiesSerialized);
return cookies ?? [];
};
exports.getCookiesFromCookieCacheIfPossible = getCookiesFromCookieCacheIfPossible;
//# sourceMappingURL=getCookiesFromCookieCache.js.map