21 lines
380 B
JavaScript
21 lines
380 B
JavaScript
export function curateMedia(media, context = {}) {
|
|
if (!media) {
|
|
return null;
|
|
}
|
|
|
|
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,
|
|
type: context.type || null,
|
|
};
|
|
}
|