export function curateMedia(media, context = {}) { if (!media) { return null; } const mime = media.mime.split('/'); return { id: media.id, hash: media.hash, path: media.path, thumbnail: media.thumbnail, lazy: media.lazy, isS3: media.is_s3, width: media.width, height: media.height, index: media.index, sharpness: media.sharpness, credit: media.credit, mime: mime && { type: mime[0], subtype: mime[1], }, type: context.type || null, }; }