Repository URL to install this package:
|
Version:
1.1.6 ▾
|
import { isObjWithKeys } from 'exotic';
function fromAddressToString(shippingAddress) {
if (isObjWithKeys(shippingAddress)) {
const { firstName, lastName, addressLine1, addressLine2, city, state, country, postalCode, phoneNumber, telephone, email, } = shippingAddress;
const addressString = `${firstName},${lastName},${addressLine1},${addressLine2},${city},${state},${country},${postalCode},
${telephone ? telephone : phoneNumber},${email}`;
return addressString;
}
else {
if (process.env.NODE_ENV !== 'production') {
console.warn('[utils] non object with keys given to fromAddressToString');
}
return '';
}
}
export { fromAddressToString };
export default fromAddressToString;
//# sourceMappingURL=fromAddressToString.js.map