dist/modules/string.js
function titlecase(val, conjunctions) {
    if (!is_1.isValue(val))
        return null;
    // conjunctions
    var conj = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
    return val.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (m, i, t) {
        if (i > 0 && i + m.length !== t.length &&
            m.search(conj) > -1 && t.charAt(i - 2) !== ';' &&
            (t.charAt(i + m.length) !== '-' || t.charAt(i - 1) === '-') &&
            t.charAt(i - 1).search(/[^\s-]/) < 0) {
            if (conjunctions === false)
                return capitalize(m);
            return m.toLowerCase();
        }
        if (m.substr(1).search(/[A-Z]|\../) > -1)
            /* istanbul ignore next */
            return m;
        return m.charAt(0).toUpperCase() + m.substr(1);
    });
}
function titlecase(val, conjunctions) {
    if (!is_1.isValue(val))
        return null;
    // conjunctions
    var conj = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
    return val.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (m, i, t) {
        if (i > 0 && i + m.length !== t.length &&
            m.search(conj) > -1 && t.charAt(i - 2) !== ';' &&
            (t.charAt(i + m.length) !== '-' || t.charAt(i - 1) === '-') &&
            t.charAt(i - 1).search(/[^\s-]/) < 0) {
            if (conjunctions === false)
                return capitalize(m);
            return m.toLowerCase();
        }
        if (m.substr(1).search(/[A-Z]|\../) > -1)
            /* istanbul ignore next */
            return m;
        return m.charAt(0).toUpperCase() + m.substr(1);
    });
}
function titlecase ( val , conjunctions ) { if ( ! is_1 . isValue ( val ) ) return null ; // conjunctions var conj = / ^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$ / i ; return val . replace ( / [A-Za-z0-9\u00C0-\u00FF]+[^\s-]* / g , function ( m , i , t ) { if ( i > 0 && i + m . length !== t . length && m . search ( conj ) > - 1 && t . charAt ( i - 2 ) !== ';' && ( t . charAt ( i + m . length ) !== '-' || t . charAt ( i - 1 ) === '-' ) && t . charAt ( i - 1 ) . search ( / [^\s-] / ) < 0 ) { if ( conjunctions === false ) return capitalize ( m ) ; return m . toLowerCase ( ) ; } if ( m . substr ( 1 ) . search ( / [A-Z]|\.. / ) > - 1 ) /* istanbul ignore next */ return m ; return m . charAt ( 0 ) . toUpperCase ( ) + m . substr ( 1 ) ; } ) ; }
Titlecase
Converts string to titlecase.

This fine script refactored from:
@see https://github.com/gouch/to-title-case

@param val the value to be transformed.
@param conjunctions when true words like and, a, but, for are also titlecased.
Titlecase Converts string to titlecase .