node_modules/detab/index.js
/* Replace tabs with spaces, being smart about which
 * column the tab is at and which size should be used. */
Replace tabs with spaces, being smart about which
column the tab is at and which size should be used.
Replace tabs with spaces being smart about which column the tab is at and which size should be used .
function detab(value, size) {
  var string = typeof value === 'string';
  var length = string && value.length;
  var start = 0;
  var index = -1;
  var column = -1;
  var tabSize = size || 4;
  var results = [];
  var code;
  var add;
  if (!string) {
    throw new Error('detab expected string');
  }
  while (++index < length) {
    code = value.charCodeAt(index);
    if (code === TAB) {
      add = tabSize - ((column + 1) % tabSize);
      column += add;
      results.push(value.slice(start, index) + repeat(' ', add));
      start = index + 1;
    } else if (code === LF || code === CR) {
      column = -1;
    } else {
      column++;
    }
  }
  results.push(value.slice(start));
  return results.join('');
}
function detab ( value , size ) { var string = typeof value === 'string' ; var length = string && value . length ; var start = 0 ; var index = - 1 ; var column = - 1 ; var tabSize = size || 4 ; var results = [ ] ; var code ; var add ; if ( ! string ) { throw new Error ( 'detab expected string' ) ; } while ( ++ index < length ) { code = value . charCodeAt ( index ) ; if ( code === TAB ) { add = tabSize - ( ( column + 1 ) % tabSize ) ; column += add ; results . push ( value . slice ( start , index ) + repeat ( ' ' , add ) ) ; start = index + 1 ; } else if ( code === LF || code === CR ) { column = - 1 ; } else { column ++ ; } } results . push ( value . slice ( start ) ) ; return results . join ( '' ) ; }
Replace tabs with spaces, being smart about which
 column the tab is at and which size should be used.
Replace tabs with spaces being smart about which column the tab is at and which size should be used .