index.js
function formatNode(node) {
  var log = node.type
  var location = node.position || {}
  var position = stringify(location.start, location.end)
  var key
  var values = []
  var value

  if (node.children) {
    log += dim('[') + yellow(node.children.length) + dim(']')
  } else if (typeof node.value === 'string') {
    log += dim(': ') + green(JSON.stringify(node.value))
  }

  if (position) {
    log += ' (' + position + ')'
  }

  for (key in node) {
    value = node[key]

    if (
      ignore.indexOf(key) !== -1 ||
      value === null ||
      value === undefined ||
      (typeof value === 'object' && isEmpty(value))
    ) {
      continue
    }

    values.push('[' + key + '=' + JSON.stringify(value) + ']')
  }

  if (values.length !== 0) {
    log += ' ' + values.join('')
  }

  return log
}
function formatNode(node) {
  var log = node.type
  var location = node.position || {}
  var position = stringify(location.start, location.end)
  var key
  var values = []
  var value

  if (node.children) {
    log += dim('[') + yellow(node.children.length) + dim(']')
  } else if (typeof node.value === 'string') {
    log += dim(': ') + green(JSON.stringify(node.value))
  }

  if (position) {
    log += ' (' + position + ')'
  }

  for (key in node) {
    value = node[key]

    if (
      ignore.indexOf(key) !== -1 ||
      value === null ||
      value === undefined ||
      (typeof value === 'object' && isEmpty(value))
    ) {
      continue
    }

    values.push('[' + key + '=' + JSON.stringify(value) + ']')
  }

  if (values.length !== 0) {
    log += ' ' + values.join('')
  }

  return log
}
function formatNode ( node ) { var log = node . type var location = node . position || { } var position = stringify ( location . start , location . end ) var key var values = [ ] var value if ( node . children ) { log += dim ( '[' ) + yellow ( node . children . length ) + dim ( ']' ) } else if ( typeof node . value === 'string' ) { log += dim ( ': ' ) + green ( JSON . stringify ( node . value ) ) } if ( position ) { log += ' (' + position + ')' } for ( key in node ) { value = node [ key ] if ( ignore . indexOf ( key ) !== - 1 || value === null || value === undefined || ( typeof value === 'object' && isEmpty ( value ) ) ) { continue } values . push ( '[' + key + '=' + JSON . stringify ( value ) + ']' ) } if ( values . length !== 0 ) { log += ' ' + values . join ( '' ) } return log }
Colored node formatter.
Colored node formatter .