Welcome to mirror list, hosted at ThFree Co, Russian Federation.

assign.js « helpers « es-abstract « node_modules - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2533d20a3619584c3abf02fe594695317dbfcce7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
var bind = require('function-bind');
var has = bind.call(Function.call, Object.prototype.hasOwnProperty);

var $assign = Object.assign;

module.exports = function assign(target, source) {
	if ($assign) {
		return $assign(target, source);
	}

	for (var key in source) {
		if (has(source, key)) {
			target[key] = source[key];
		}
	}
	return target;
};