lib/libs.js
function rtrim (s, what) {
                    what = typeof what === 'string' ? what : '\\s+';
                    return s.replace(new RegExp(what + '$'), '');
                }
function rtrim (s, what) {
                    what = typeof what === 'string' ? what : '\\s+';
                    return s.replace(new RegExp(what + '$'), '');
                }
Right trims a string. Same as String.trim, but only for the end of a string.
@param {String} s The string to operate on.
@param {String} [what='\\s+'] What to trim.
@return {String} The right trimmed string