UNPKG

dastal

Version:

Data Structures & Algorithms implementations

16 lines 434 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.pad = void 0; /** * Pad a string from both sides. */ function pad(str, maxLen, fillString) { const len = str.length; if (len >= maxLen) { return str; } const diff = maxLen - len; return str.padStart(len + diff / 2, fillString).padEnd(len + diff, fillString); } exports.pad = pad; //# sourceMappingURL=stringUtils.js.map