Skip to content

Instantly share code, notes, and snippets.

View ghoshanjega's full-sized avatar
👨‍🎨
Drive free or die

Ghoshan J ghoshanjega

👨‍🎨
Drive free or die
View GitHub Profile
import _ from 'lodash'
import qs from 'qs'
// @see https://www.contentful.com/developers/docs/references/images-api/#/reference/resizing-&-cropping/specify-width-&-height
const CONTENTFUL_IMAGE_MAX_SIZE = 4000
const isImage = image =>
_.includes(
[`image/jpeg`, `image/jpg`, `image/png`, `image/webp`, `image/gif`],
_.get(image, `file.contentType`)
)