generator-ssjs
Version:
yo generator to scaffold an [SSJS Framework](https://adessose.github.io/ssjs-webpack/) project. ## Installation ``` # install yo npm install --global yo
15 lines • 695 B
JavaScript
if (!String.prototype.padEnd) {
String.prototype.padEnd = function (targetLength, padString) {
targetLength = targetLength >> 0; //floor if number or convert non-number to 0;
padString = (typeof padString !== 'undefined') ? padString : ' ';
if (this.length > targetLength) {
return String(this);
} else {
targetLength = targetLength - this.length;
if (targetLength > padString.length) {
padString += padString.repeat(targetLength / padString.length); //append to original to ensure we are longer than needed
}
return String(this) + padString.slice(0, targetLength);
}
}
}