All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.helpers.assign.js Maven / Gradle / Ivy

There is a newer version: 1.22.3
Show newest version
'use strict';

var GetIntrinsic = require('get-intrinsic');

var has = require('has');

var $assign = GetIntrinsic('%Object.assign%', true);

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

	// eslint-disable-next-line no-restricted-syntax
	for (var key in source) {
		if (has(source, key)) {
			// eslint-disable-next-line no-param-reassign
			target[key] = source[key];
		}
	}
	return target;
};




© 2015 - 2025 Weber Informatics LLC | Privacy Policy