function clone (obj, parent) {
  let cloned = new obj.constructor()

  for (let i of Object.keys(obj || {})) {
    let value = obj[i]
    if (i === 'parent' && typeof value === 'object') {
      if (parent) {
        cloned[i] = parent
      }
    } else if (i === 'source' || i === null) {
      cloned[i] = value
    } else if (value instanceof Array) {
      cloned[i] = value.map(x => clone(x, cloned))
    } else if (i !== '_autoprefixerPrefix' && i !== '_autoprefixerValues') {
      if (typeof value === 'object' && value !== null) {
        value = clone(value, cloned)
      }
      cloned[i] = value
    }
  }

  return cloned
}
function clone (obj, parent) {
  let cloned = new obj.constructor()

  for (let i of Object.keys(obj || {})) {
    let value = obj[i]
    if (i === 'parent' && typeof value === 'object') {
      if (parent) {
        cloned[i] = parent
      }
    } else if (i === 'source' || i === null) {
      cloned[i] = value
    } else if (value instanceof Array) {
      cloned[i] = value.map(x => clone(x, cloned))
    } else if (i !== '_autoprefixerPrefix' && i !== '_autoprefixerValues') {
      if (typeof value === 'object' && value !== null) {
        value = clone(value, cloned)
      }
      cloned[i] = value
    }
  }

  return cloned
}
function clone ( obj , parent ) { let cloned = new obj . constructor ( ) for ( let i of Object . keys ( obj || { } ) ) { let value = obj [ i ] if ( i === 'parent' && typeof value === 'object' ) { if ( parent ) { cloned [ i ] = parent } } else if ( i === 'source' || i === null ) { cloned [ i ] = value } else if ( value instanceof Array ) { cloned [ i ] = value . map ( x => clone ( x , cloned ) ) } else if ( i !== '_autoprefixerPrefix' && i !== '_autoprefixerValues' ) { if ( typeof value === 'object' && value !== null ) { value = clone ( value , cloned ) } cloned [ i ] = value } } return cloned }
Recursively clone objects
Recursively clone objects
Clone an object