Sha256: dafe96c563b82a17093dd16411d83b42274c0a9488b475ff23995306d75862d8

Contents?: true

Size: 1.27 KB

Versions: 52

Compression:

Stored size: 1.27 KB

Contents

'use strict';

// modified from https://github.com/es-shims/es6-shim
var keys = require('object-keys');
var bind = require('function-bind');
var canBeObject = function (obj) {
	return typeof obj !== 'undefined' && obj !== null;
};
var hasSymbols = require('has-symbols/shams')();
var toObject = Object;
var push = bind.call(Function.call, Array.prototype.push);
var propIsEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable);
var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;

module.exports = function assign(target, source1) {
	if (!canBeObject(target)) { throw new TypeError('target must be an object'); }
	var objTarget = toObject(target);
	var s, source, i, props, syms, value, key;
	for (s = 1; s < arguments.length; ++s) {
		source = toObject(arguments[s]);
		props = keys(source);
		var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
		if (getSymbols) {
			syms = getSymbols(source);
			for (i = 0; i < syms.length; ++i) {
				key = syms[i];
				if (propIsEnumerable(source, key)) {
					push(props, key);
				}
			}
		}
		for (i = 0; i < props.length; ++i) {
			key = props[i];
			value = source[key];
			if (propIsEnumerable(source, key)) {
				objTarget[key] = value;
			}
		}
	}
	return objTarget;
};

Version data entries

52 entries across 52 versions & 10 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/object.assign/implementation.js
disco_app-0.18.0 test/dummy/node_modules/object.assign/implementation.js
disco_app-0.18.2 test/dummy/node_modules/object.assign/implementation.js
disco_app-0.16.1 test/dummy/node_modules/object.assign/implementation.js
disco_app-0.15.2 test/dummy/node_modules/object.assign/implementation.js
disco_app-0.18.4 test/dummy/node_modules/object.assign/implementation.js
disco_app-0.18.1 test/dummy/node_modules/object.assign/implementation.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/object.assign/implementation.js
disco_app-0.14.0 test/dummy/node_modules/object.assign/implementation.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/object.assign/implementation.js
enju_library-0.3.8 spec/dummy/node_modules/object.assign/implementation.js
condenser-0.3 lib/condenser/processors/node_modules/object.assign/implementation.js
ilog-0.4.1 node_modules/object.assign/implementation.js
ilog-0.4.0 node_modules/object.assign/implementation.js
ilog-0.3.3 node_modules/object.assign/implementation.js
condenser-0.2 lib/condenser/processors/node_modules/object.assign/implementation.js
condenser-0.1 lib/condenser/processors/node_modules/object.assign/implementation.js
condenser-0.0.12 lib/condenser/processors/node_modules/object.assign/implementation.js
condenser-0.0.11 lib/condenser/processors/node_modules/object.assign/implementation.js
condenser-0.0.10 lib/condenser/processors/node_modules/object.assign/implementation.js