dist/modules/string.js
function padLeft(val, len, offset, char) {
    /* istanbul ignore if */
    if (!is_1.isValue(val) || !is_1.isString(val))
        return null;
    // If offset is a string
    // count its length.
    if (is_1.isString(offset))
        offset = offset.length;
    char = char || ' ';
    var pad = '';
    while (len--) {
        pad += char;
    }
    if (offset)
        return padLeft('', offset, null, char) + pad + val;
    return pad + val;
}
function padLeft(val, len, offset, char) {
    /* istanbul ignore if */
    if (!is_1.isValue(val) || !is_1.isString(val))
        return null;
    // If offset is a string
    // count its length.
    if (is_1.isString(offset))
        offset = offset.length;
    char = char || ' ';
    var pad = '';
    while (len--) {
        pad += char;
    }
    if (offset)
        return padLeft('', offset, null, char) + pad + val;
    return pad + val;
}
function padLeft ( val , len , offset , char ) { /* istanbul ignore if */ if ( ! is_1 . isValue ( val ) || ! is_1 . isString ( val ) ) return null ; // If offset is a string // count its length. if ( is_1 . isString ( offset ) ) offset = offset . length ; char = char || ' ' ; var pad = '' ; while ( len -- ) { pad += char ; } if ( offset ) return padLeft ( '' , offset , null , char ) + pad + val ; return pad + val ; }
Pad Left
Pads a string on the left.

@param val the string to be padded.
@param len the length to pad.
@param offset an offset number or string to be counted.
@param char the character to pad with.
Pad Left Pads a string on the left .