lib/object-tools.js
function extend () {
  var depth = 0
  var args = arrayify(arguments)
  if (!args.length) return {}
  var last = args[args.length - 1]
  if (t.isPlainObject(last) && '__depth' in last) {
    depth = last.__depth
    args.pop()
  }
  return args.reduce(function (output, curr) {
    if (typeof curr !== 'object') return output
    for (var prop in curr) {
      var value = curr[prop]
      if (value === undefined) break
      if (t.isObject(value) && !Array.isArray(value) && depth < 10) {
        if (!output[prop]) output[prop] = {}
        output[prop] = extend(output[prop], value, { __depth: ++depth })
      } else {
        output[prop] = value
      }
    }
    return output
  }, {})
}
function extend () {
  var depth = 0
  var args = arrayify(arguments)
  if (!args.length) return {}
  var last = args[args.length - 1]
  if (t.isPlainObject(last) && '__depth' in last) {
    depth = last.__depth
    args.pop()
  }
  return args.reduce(function (output, curr) {
    if (typeof curr !== 'object') return output
    for (var prop in curr) {
      var value = curr[prop]
      if (value === undefined) break
      if (t.isObject(value) && !Array.isArray(value) && depth < 10) {
        if (!output[prop]) output[prop] = {}
        output[prop] = extend(output[prop], value, { __depth: ++depth })
      } else {
        output[prop] = value
      }
    }
    return output
  }, {})
}
function extend ( ) { var depth = 0 var args = arrayify ( arguments ) if ( ! args . length ) return { } var last = args [ args . length - 1 ] if ( t . isPlainObject ( last ) && '__depth' in last ) { depth = last . __depth args . pop ( ) } return args . reduce ( function ( output , curr ) { if ( typeof curr !== 'object' ) return output for ( var prop in curr ) { var value = curr [ prop ] if ( value === undefined ) break if ( t . isObject ( value ) && ! Array . isArray ( value ) && depth < 10 ) { if ( ! output [ prop ] ) output [ prop ] = { } output [ prop ] = extend ( output [ prop ] , value , { __depth : ++ depth } ) } else { output [ prop ] = value } } return output } , { } ) }
Merge a list of objects, left to right, into one - to a maximum depth of 10.

@param {...object} object - a sequence of object instances to be extended
@returns {object}
@static
@example
> o.extend({ one: 1, three: 3 }, { one: 'one', two: 2 }, { four: 4 })
{ one: 'one',
three: 3,
two: 2,
four: 4 }
Merge a list of objects left to right into one - to a maximum depth of 10 .