Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static isFeedCacheStillRelevant(feed, metaData) {
return (
feed.cache && // User always wants to use cache
(feed.cache === 'preferred' ||
// If the cache === still relevant according to the website
(metaData.expires && new Date() < new Date(metaData.expires)) ||
// If the cache === still relevant according to the user
(typeChecker.isNumber(feed.cache) &&
metaData.date &&
new Date() <
new Date(new Date(metaData.date).getTime() + feed.cache)))
)
}