Code coverage report for string/rpad.js

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

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