export function findAppropriateImage(images, wantedWidth) {
    if (!images || images.length === 0)
        return undefined;
    const imagesSorted = images.sort((a, b) => a.width - b.width);
    for (const image of imagesSorted) {
        if (image.width >= wantedWidth) {
            return image;
        }
    }
    return images[images.length - 1];
}
//# sourceMappingURL=image.js.map