This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
machines-backup/extrusion/lydia-print-head-v1/firmware/node/build/format.js

22 lines
759 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.render = void 0;
const types_1 = require("./types");
const log_1 = require("./log");
exports.render = (result, options) => {
switch (options.format) {
case types_1.OutputFormat.text: {
//@TODO: human readable format
return JSON.stringify(result, null, 2);
}
case types_1.OutputFormat.json: {
return JSON.stringify(result, null, 2);
}
default: {
//private, should never happen since options had to be sanitized
log_1.error('format::render Invalid value in options.format');
return '';
}
}
};
//# sourceMappingURL=format.js.map