appcenter-cli
Version:
Command line tool for Visual Studio App Center
24 lines (23 loc) • 680 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
//
// Misc string padding - no npm disasters for us! :-)
//
const debug = require("debug")("appcenter-cli:util:interaction:padding");
function padding(width, text) {
const len = text.length;
if (len >= width) {
return "";
}
debug(`Adding ${width - len + 1} spaces of padding to width ${width}`);
return new Array(width - len + 1).join(" ");
}
exports.padding = padding;
function padLeft(width, text) {
return padding(width, text) + text;
}
exports.padLeft = padLeft;
function padRight(width, text) {
return text + padding(width, text);
}
exports.padRight = padRight;