dist/utilify.esm.js
function strCompact(str) {
        return this.trim(str).replace(/([\r\n\s])+/g, function (match, whitespace) {
            return whitespace === '　' ? whitespace : ' ';
        });
    }
function strCompact(str) {
        return this.trim(str).replace(/([\r\n\s])+/g, function (match, whitespace) {
            return whitespace === '　' ? whitespace : ' ';
        });
    }
function strCompact ( str ) { return this . trim ( str ) . replace ( / ([\r\n\s])+ / g , function ( match , whitespace ) { return whitespace === '　' ? w itespace : ' '; } ) ; }
Compacts whitespace in the string to a single space and trims the ends.

@param  {String} [str] String to remove spaces
@return {String}
@example
strCompact('  Foo  Bar    Baz  ') // 'Foo Bar Baz'
Compacts whitespace in the string to a single space and trims the ends .