src/index.js
function _props (opts, source, target) {
  let idx = opts.visited.indexOf(source) // check for circularities
  if (idx === -1) {
    opts.visited.push(source)
    opts.cloned.push(target)
    Object.getOwnPropertyNames(source).forEach(function (key) {
      if (key === 'prototype') {
        target[key] = Object.create(source[key])
        Object.getOwnPropertyNames(source[key]).forEach(function (p) {
          if (p !== 'constructor') {
            _descriptor(opts, source[key], target[key], p)
            // } else {
            //   target[key][p] = target
            //   Safari may throw here with TypeError: Attempted to assign to readonly property.
          }
        })
      } else {
        _descriptor(opts, source, target, key)
      }
    })
    opts.visited.pop()
    opts.cloned.pop()
  } else {
    target = opts.cloned[idx] // add reference of circularity
  }
  return target
}
function _props (opts, source, target) {
  let idx = opts.visited.indexOf(source) // check for circularities
  if (idx === -1) {
    opts.visited.push(source)
    opts.cloned.push(target)
    Object.getOwnPropertyNames(source).forEach(function (key) {
      if (key === 'prototype') {
        target[key] = Object.create(source[key])
        Object.getOwnPropertyNames(source[key]).forEach(function (p) {
          if (p !== 'constructor') {
            _descriptor(opts, source[key], target[key], p)
            // } else {
            //   target[key][p] = target
            //   Safari may throw here with TypeError: Attempted to assign to readonly property.
          }
        })
      } else {
        _descriptor(opts, source, target, key)
      }
    })
    opts.visited.pop()
    opts.cloned.pop()
  } else {
    target = opts.cloned[idx] // add reference of circularity
  }
  return target
}
function _props ( opts , source , target ) { let idx = opts . visited . indexOf ( source ) // check for circularities if ( idx === - 1 ) { opts . visited . push ( source ) opts . cloned . push ( target ) Object . getOwnPropertyNames ( source ) . forEach ( function ( key ) { if ( key === 'prototype' ) { target [ key ] = Object . create ( source [ key ] ) Object . getOwnPropertyNames ( source [ key ] ) . forEach ( function ( p ) { if ( p !== 'constructor' ) { _descriptor ( opts , source [ key ] , target [ key ] , p ) // } else { //   target[key][p] = target //   Safari may throw here with TypeError: Attempted to assign to readonly property. } } ) } else { _descriptor ( opts , source , target , key ) } } ) opts . visited . pop ( ) opts . cloned . pop ( ) } else { target = opts . cloned [ idx ] // add reference of circularity } return target }
Clone property while cloning circularities

@static
@private
@param {Object} opts - options
@param {Any} source - source object
@param {Any} [target] - target object
@returns {Any} target
Clone property while cloning circularities