Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
...fieldAttrs,
...parsedAttrs,
};
// tslint:disable-next-line:prefer-const
let { src, srcSet, ...otherAttrs } = combinedAttrs;
if (!src) {
return null;
}
const newAttrs = {
...otherAttrs,
};
// update image URL for jss handler and image rendering params
src = mediaApi.updateImageUrl(src, imageParams);
if (srcSet) {
// replace with HTML-formatted srcset, including updated image URLs
newAttrs.srcSet = mediaApi.getSrcSet(src, srcSet, imageParams);
} else {
newAttrs.src = src;
}
return newAttrs;
}
},
imageParams: any
) => {
if (!src) {
return null;
}
const newAttrs: any = {
...otherAttrs,
};
// update image URL for jss handler and image rendering params
const resolvedSrc = mediaApi.updateImageUrl(src, imageParams);
if (srcSet) {
// replace with HTML-formatted srcset, including updated image URLs
newAttrs.srcSet = mediaApi.getSrcSet(resolvedSrc, srcSet, imageParams);
} else {
newAttrs.src = resolvedSrc;
}
return newAttrs;
};