Repository URL to install this package:
|
Version:
0.14.1 ▾
|
// import { getWidthHeight } from './getWidthHeight'
// // import { calculateAspectRatio } from './calculateAspectRatio'
// // import { toPlaceholder } from './toPlaceholder'
import { isImageLike } from './isImage'
import { toSecureProtocol } from 'uxui-modules/utils/toSecureProtocol'
// 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