lib/formatter.js
function _wrapString(value) {
    var segments,
        asIndex = value.toLowerCase().indexOf(' as ');
    if (asIndex !== -1) {
      var first = value.slice(0, asIndex);
      var second = value.slice(asIndex + 4);
      return this.alias(this.wrap(first), this.wrap(second));
    }
    var i = -1,
        wrapped = [];
    segments = value.split('.');
    while (++i < segments.length) {
      value = segments[i];
      if (i === 0 && segments.length > 1) {
        wrapped.push(this.wrap((value || '').trim()));
      } else {
        wrapped.push(this.client.wrapIdentifier((value || '').trim()));
      }
    }
    return wrapped.join('.');
  }
function _wrapString(value) {
    var segments,
        asIndex = value.toLowerCase().indexOf(' as ');
    if (asIndex !== -1) {
      var first = value.slice(0, asIndex);
      var second = value.slice(asIndex + 4);
      return this.alias(this.wrap(first), this.wrap(second));
    }
    var i = -1,
        wrapped = [];
    segments = value.split('.');
    while (++i < segments.length) {
      value = segments[i];
      if (i === 0 && segments.length > 1) {
        wrapped.push(this.wrap((value || '').trim()));
      } else {
        wrapped.push(this.client.wrapIdentifier((value || '').trim()));
      }
    }
    return wrapped.join('.');
  }
function _wrapString ( value ) { var segments , asIndex = value . toLowerCase ( ) . indexOf ( ' as ' ) ; if ( asIndex !== - 1 ) { var first = value . slice ( 0 , asIndex ) ; var second = value . slice ( asIndex + 4 ) ; return this . alias ( this . wrap ( first ) , this . wrap ( second ) ) ; } var i = - 1 , wrapped = [ ] ; segments = value . split ( '.' ) ; while ( ++ i < segments . length ) { value = segments [ i ] ; if ( i === 0 && segments . length > 1 ) { wrapped . push ( this . wrap ( ( value || '' ) . trim ( ) ) ) ; } else { wrapped . push ( this . client . wrapIdentifier ( ( value || '' ) . trim ( ) ) ) ; } } return wrapped . join ( '.' ) ; }
Coerce to string to prevent strange errors when it's not a string.
Coerce to string to prevent strange errors when it s not a string .