mirror of
https://github.com/zoo-labs/zoo.git
synced 2026-11-10 22:32:34 +00:00
8 lines
236 B
TypeScript
8 lines
236 B
TypeScript
const normalize = (src) => {
|
|
return src[0] === '/' ? src.slice(1) : src
|
|
}
|
|
|
|
export const cloudinaryLoader = ({ src, width, style }) => {
|
|
return `https://res.cloudinary.com/dnz2bkszg/image/fetch/f_auto,w_${width}/${normalize(src)}`
|
|
}
|