• Home
  • Raw
  • Download

Lines Matching full:max

17  * Pad `str` up to total length `max` with `chr`.
18 * If `str` is longer than `max`, padRight will return `str` unaltered.
21 * @param Number max total length of output string
26 function padRight(str, max, chr) { argument
29 var length = max - wcwidth(str)
35 * Pad `str` up to total length `max` with `chr`.
36 * If `str` is longer than `max`, padCenter will return `str` unaltered.
39 * @param Number max total length of output string
44 function padCenter(str, max, chr) { argument
47 var length = max - wcwidth(str)
55 * Pad `str` up to total length `max` with `chr`, on the left.
56 * If `str` is longer than `max`, padRight will return `str` unaltered.
59 * @param Number max total length of output string
64 function padLeft(str, max, chr) { argument
67 var length = max - wcwidth(str)
73 * Split a String `str` into lines of maxiumum length `max`.
77 * @param Number max length of each line
81 function splitIntoLines(str, max) { argument
82 function _splitIntoLines(str, max) { argument
85 if (line && wcwidth(line.join(' ')) + wcwidth(word) < max) {
95 return _splitIntoLines(str, max)
103 * `str` which are longer than `max`.
106 * @param Number max length of each line
111 function splitLongWords(str, max, truncationChar) { argument
127 if (wcwidth(word) > max) {
131 var limit = max - truncationWidth
155 * Truncate `str` into total width `max`
156 * If `str` is shorter than `max`, will return `str` unaltered.
159 * @param Number max total wcwidth of output string
163 function truncateString(str, max) { argument
168 if(max == Infinity) return str
174 if(w + wwidth > max)