Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var getKeywords = function () {
var keywords = [];
_.each(caniuse.data, function (item) {
if (item.keywords === '') { return; }
keywords = keywords.concat(item.keywords.split(','));
});
return keywords;
};
var query = function (keyword, browser, version) {
if (_.isUndefined(caniuse.agents[browser])) {
logger.warn('Skipping ' + browser, '- It is not a recognized browser');
return null;
} else if (!_.contains(caniuse.agents[browser].versions, version)) {
logger.warn('Skipping ' + browser, version, '- It is not a recognized version');
return null;
}
var propertyData = _.find(caniuse.data, function (item) {
return item.keywords.indexOf(keyword) !== -1;
});
return propertyData ? propertyData.stats[browser][version] : null;
};