fix: Array.at() non supporté par Node 14

pull/1/head
Jalil Arfaoui 2022-10-23 01:26:05 +02:00
parent e3bf770550
commit b55be6eb78
1 changed files with 2 additions and 1 deletions

View File

@ -32,10 +32,11 @@ const getLargestImage = (imageMetadata, format) => {
const imgHtmlString = (image, imageMetadata) => {
const largestUnoptimizedImg = getLargestImage(imageMetadata, "jpeg");
const imagePath = image.split('/')
const imgAttributes = stringifyAttributes({
src: largestUnoptimizedImg.url,
alt: image.split('/').at(-1),
alt: imagePath[imagePath.length-1],
loading: 'lazy',
decoding: 'async',
});