index.js
function merge (dest, src, redefine) {
  if (!dest) {
    throw new TypeError('argument dest is required')
  }

  if (!src) {
    throw new TypeError('argument src is required')
  }

  if (redefine === undefined) {
    // Default to true
    redefine = true
  }

  Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName (name) {
    if (!redefine && hasOwnProperty.call(dest, name)) {
      // Skip descriptor
      return
    }

    // Copy descriptor
    var descriptor = Object.getOwnPropertyDescriptor(src, name)
    Object.defineProperty(dest, name, descriptor)
  })

  return dest
}
function merge (dest, src, redefine) {
  if (!dest) {
    throw new TypeError('argument dest is required')
  }

  if (!src) {
    throw new TypeError('argument src is required')
  }

  if (redefine === undefined) {
    // Default to true
    redefine = true
  }

  Object.getOwnPropertyNames(src).forEach(function forEachOwnPropertyName (name) {
    if (!redefine && hasOwnProperty.call(dest, name)) {
      // Skip descriptor
      return
    }

    // Copy descriptor
    var descriptor = Object.getOwnPropertyDescriptor(src, name)
    Object.defineProperty(dest, name, descriptor)
  })

  return dest
}
function merge ( dest , src , redefine ) { if ( ! dest ) { throw new TypeError ( 'argument dest is required' ) } if ( ! src ) { throw new TypeError ( 'argument src is required' ) } if ( redefine === undefined ) { // Default to true redefine = true } Object . getOwnPropertyNames ( src ) . forEach ( function forEachOwnPropertyName ( name ) { if ( ! redefine && hasOwnProperty . call ( dest , name ) ) { // Skip descriptor return } // Copy descriptor var descriptor = Object . getOwnPropertyDescriptor ( src , name ) Object . defineProperty ( dest , name , descriptor ) } ) return dest }
Merge the property descriptors of `src` into `dest`

@param {object} dest Object to add descriptors to
@param {object} src Object to clone descriptors from
@param {boolean} [redefine=true] Redefine `dest` properties with `src` properties
@returns {object} Reference to dest
@public
Merge the property descriptors of src into dest