Repository URL to install this package:
|
Version:
1.0.10 ▾
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const exotic_1 = require("exotic");
const ORDER_STATUS_LABEL = {
'NONE': 'None',
'ONHOLD': 'On hold',
'SUBMITTED': 'Submitted',
'READYTOEDIT': 'Ready to edit',
'FREEZEEDIT': 'Freeze edit',
'SUBMITTEDTOFULFILMENT': 'Submitted to fulfillment',
'READYTOSHIP': 'Ready to ship',
'SHIPPED': 'Shipped',
'RETURNSUBMITTED': 'Return submitted',
'UNABLETOSHIP': 'Unable to ship',
// Cancelled in India/British english
'CANCELED': 'Canceled',
'DELIVERED': 'Delivered',
'STANDARD_DELIVERY': 'Standard Delivery',
};
function formatOrderStatus(status) {
/**
* @todo @fixme @invalid
* @note @ganesh
* this is bad performance
* obviously was copied from formatPrice which is @deprecated
* this is not a reusable util, this is a domain specific data
*/
if (exotic_1.isString(status)) {
return ORDER_STATUS_LABEL[status] || exotic_1.EMPTY_STRING;
}
else {
return 'N/A';
}
// try {
// return ORDER_STATUS_LABEL[status]
// } catch (error) {
// return 'N/A'
// }
}
exports.formatOrderStatus = formatOrderStatus;
exports.default = formatOrderStatus;
//# sourceMappingURL=formatOrderStatus.js.map