Repository URL to install this package:
|
Version:
2.3.21 ▾
|
// import { getWidthHeight } from './getWidthHeight'
// // import { calculateAspectRatio } from './calculateAspectRatio'
// // import { toPlaceholder } from './toPlaceholder'
import { toSecureProtocol } from '@skava/utils'
import { isImageLike } from './isImage'
// eslint-disable-next-line
export const fromPropsToSrc = props => {
const alt = props.alt || ''
let src = props.src || ''
if (isImageLike(alt)) {
src = alt
}
const url =
src ||
alt ||
props.src ||
props.imageSrc ||
props.url ||
props.value ||
props.imageSource
return toSecureProtocol(url)
}
export const fromPropsToAlt = props =>
props.caption ||
props.text ||
props.alternateImage ||
props.label ||
props.alt