Code coverage report for string/lpad.js

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

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