Esempio n. 1
0
/**
 * Creates a stream that merges objects together and outputs them each step
 * @param {Object} state Optional initial state for the object
 */
function mergerStream(state, options) {
	state = state || {};
	options = extend.createOptions(options || {});
	return through2.obj(function (chunk, encoding, cb) {
		cb(null, state = extend(options, state, chunk));
	});
}
Esempio n. 2
0
ObjectManage.prototype.$objectMerge = function(obj1,obj2){
  var opts = objectMerge.createOptions({
    depth: this.$maxDepth,
    throwOnCircularRef: true
  })
  return objectMerge(opts,obj1,obj2)
}