@rawcmd/typewriters
Version:
Collection of typewriters for styling command-line messages for Rawcmd.
27 lines • 760 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@rawcmd/utils");
const text_1 = require("./text");
const row_1 = require("./row");
function titleTypewriter(options) {
options = Object.assign({ totalWidth: 80 }, options);
const writeTitle = text_1.textTypewriter({
bold: true,
});
const writeBody = row_1.rowTypewriter([
{
index: 0,
width: options.totalWidth,
},
]);
return (text) => {
if (!utils_1.isString(text) || !text) {
return '';
}
return writeBody([
writeTitle(text.toUpperCase()),
]);
};
}
exports.titleTypewriter = titleTypewriter;
//# sourceMappingURL=title.js.map