UNPKG

appcenter-cli

Version:

Command line tool for Visual Studio App Center

25 lines (24 loc) 743 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.padRight = exports.padLeft = exports.padding = void 0; // // 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;