backpack-ui
Version:
Lonely Planet's Components
12 lines (10 loc) • 372 B
JavaScript
/**
* Check for a size keyword within a provider's image path
* @param {String} imagePath Path of the image to check
* @param {String} size Size keyword to check
* @return {Boolean} Does the size match?
*/
export default function providerImageSize(imagePath, size) {
if (typeof size === "number") return false;
return imagePath.includes(size);
}