@ecomplus/utils
Version:
JS utility functions to E-Com Plus (not only) related apps
25 lines • 736 B
TypeScript
export default parsePhone;
/**
* @method
* @memberof ecomUtils
* @name parsePhone
* @description Returns customer phone object from string.
* @param {string} phoneStr - Phone string
* @returns {Object.<string, *>}
*
* @example
* // Phone string is fixed and parsed to object with `number`
* ecomUtils.parsePhone('31992980000')
* // => { number: '31992980000' }
* ecomUtils.parsePhone('31 99298-1000')
* // => { number: '31992981000' }
*
* @example
* // Country code is optional and identified by + signal
* ecomUtils.parsePhone('+55 31992980000')
* // => { country_code: 55, number: '31992980000' }
*/
declare function parsePhone(phoneStr: string): {
[x: string]: any;
};
//# sourceMappingURL=parse-phone.d.ts.map