Files
imphnen-frontend-service/apps/landing/src/lib/format.ts
T

11 lines
257 B
TypeScript
Raw Normal View History

import { Media } from '../payload-types';
export function formatCMSImageDataToMedia(
image: number | Media | null | undefined
): Media | null {
if (image && typeof image === 'object' && 'url' in image) {
return image as Media;
}
return null;
}