function clean (node) {
  delete node.inputs;
  if (node.source) delete node.source.inputId
  delete node.indexes
  delete node.lastEach
  delete node.rawCache

  if (node.nodes) node.nodes = node.nodes.map(clean)

  return node
}

module.exports = function jsonify (node) {
  let cleaned = clean(node.toJSON())
  return JSON.stringify(cleaned, null, 2)
}

function clean (node) {
  if (node.source) {
    delete node.source.input
    delete node.source.inputId
  }
  delete node.inputs
  delete node.indexes
  delete node.lastEach
  delete node.rawCache

  if (node.nodes) node.nodes = node.nodes.map(clean)

  return node
}

module.exports = function jsonify (node) {
  let cleaned = clean(node.toJSON())
  return JSON.stringify(cleaned, null, 2)
}

Remove fields from PostCSS 8.2.1
Remove fields from PostCSS 8.2.1
