google-trends-api-client
Version:
An fully typed and easy to use client for the google trends api.
17 lines • 880 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCookiesHeadersFromCookieCacheIfPossible = void 0;
const simple_cookie_client_1 = require("simple-cookie-client");
const getCookiesFromCookieCache_1 = require("./getCookiesFromCookieCache");
const getCookiesHeadersFromCookieCacheIfPossible = async ({ cookieCache, }) => {
// lookup the values from the cache
const cookies = await (0, getCookiesFromCookieCache_1.getCookiesFromCookieCacheIfPossible)({ cookieCache });
if (!cookies || !cookies.length)
return null;
// cast the cookies to header
return {
cookie: (0, simple_cookie_client_1.castCookiesToCookieHeaderString)(cookies),
};
};
exports.getCookiesHeadersFromCookieCacheIfPossible = getCookiesHeadersFromCookieCacheIfPossible;
//# sourceMappingURL=getCookiesHeadersFromCookieCacheIfPossible.js.map