Code coverage report for string/rpad.js

Statements: 100% (7 / 7)      Branches: 75% (3 / 4)      Functions: 100% (3 / 3)      Lines: 100% (6 / 6)     

All files » string/ » rpad.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 151         1 7 7 7     1      
define(['../lang/toString', './repeat'], function (toString, repeat) {
 
    /**
     * Pad string with `char` if its' length is smaller than `minLen`
     */
    function rpad(str, minLen, ch) {
        str = toString(str);
        ch = ch || ' ';
        return (str.length < minLen)? str + repeat(ch, minLen - str.length) : str;
    }
 
    return rpad;
 
});