blob: 30bb8be84cb10c2272c7b442b8013470343fe729 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import { Image } from '@ts/types/app';
import { RawCover } from '@ts/types/raw-data';
/**
* Retrieve an Image object from raw data.
*
* @param image - The cover raw data.
* @returns {Image} - An Image object.
*/
export const getImageFromRawData = (image: RawCover): Image => {
return {
alt: image.altText,
height: image.mediaDetails.height,
src: image.sourceUrl,
title: image.title,
width: image.mediaDetails.width,
};
};
|