@ecomplus/utils
Version:
JS utility functions to E-Com Plus (not only) related apps
25 lines • 713 B
TypeScript
export default imgSizes;
/**
* @method
* @memberof ecomUtils
* @name imgSizes
* @description Splits image size string and returns object with 'width' and 'height'.
* @param {Object.<string, *>|string} img - Image object body or size string
* @returns {Object.<string, *>}
*
* @example
* // Using a img sizes string as parameter
* const size = '200x50'
* ecomUtils.imgSizes(size)
* // => {width: 200, height: 50}
* // Using a img sizes object as parameter
* const sizeObj = {size: '1000x1000'}
* ecomUtils.imgSizes(sizeObj)
* // => {width: 1000, height: 1000}
*/
declare function imgSizes(img: {
[x: string]: any;
} | string): {
[x: string]: any;
};
//# sourceMappingURL=img-sizes.d.ts.map