react-native-esc-pos-printer
Version:
An unofficial React Native library for printing on an EPSON TM printer with the Epson ePOS SDK for iOS and Epson ePOS SDK for Android
21 lines (20 loc) • 641 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.parsePrinterStatus = parsePrinterStatus;
var _index = require("../../constants/index.js");
function parsePrinterStatus(response) {
return Object.keys(response).reduce((acc, propName) => {
const statusCode = response[propName];
const message = _index.GetPrinterStatusMessageMapping[propName][statusCode];
const status = _index.PrinterStatusMapping[propName][statusCode];
acc[propName] = {
status,
message,
statusCode: Number(statusCode)
};
return acc;
}, {});
}
//# sourceMappingURL=parsePrinterStatus.js.map