airgap-coin-lib
Version:
The airgap-coin-lib is a protocol agnostic library to prepare, sign and broadcast cryptocurrency transactions.
19 lines • 720 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function padStart(targetString, targetLength, padString) {
// truncate if number, or convert non-number to 0
targetLength = targetLength >> 0;
if (targetString.length >= targetLength) {
return targetString;
}
else {
targetLength = targetLength - targetString.length;
if (targetLength > padString.length) {
// append to original to ensure we are longer than needed
padString += padString.repeat(targetLength / padString.length);
}
return padString.slice(0, targetLength) + targetString;
}
}
exports.padStart = padStart;
//# sourceMappingURL=padStart.js.map