Sha256: 363b424396cb9cf845ab7e4744e45475a9b239d4902b174273854ebf63cd6864
Contents?: true
Size: 388 Bytes
Versions: 69
Compression:
Stored size: 388 Bytes
Contents
var toString = require('../lang/toString'); var repeat = require('./repeat'); /** * Pad string with `char` if its' length is smaller than `minLen` */ function lpad(str, minLen, ch) { str = toString(str); ch = ch || ' '; return (str.length < minLen) ? repeat(ch, minLen - str.length) + str : str; } module.exports = lpad;
Version data entries
69 entries across 69 versions & 2 rubygems