Object.assign shim

An Object.assign shim.

Bu script direkt olarak kurulamaz. Başka scriptler için bir kütüphanedir ve meta yönergeleri içerir // @require https://update.greasyfork.org/scripts/2666/7344/Objectassign%20shim.js

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        Object.assign shim
// @description An Object.assign shim.
// @version     0.13.0
// @license     MIT License;
// ==/UserScript==
// modified from https://github.com/es-shims/es6-shim
(function(){
	'use strict';
	
	var isObject = function (obj) {
		return obj && typeof obj === 'object';
	};

	if(Object.assign) return;
	Object.defineProperty(Object, 'assign', {
		value: function(target, source){
			var s, i, props;
			if (!isObject(target)) { throw new TypeError('target must be an object'); }
			for (s = 1; s < arguments.length; ++s) {
				source = arguments[s];
				if (!isObject(source)) { throw new TypeError('source ' + s + ' must be an object'); }
				props = Object.keys(Object(source));
				for (i = 0; i < props.length; ++i) {
					target[props[i]] = source[props[i]];
				}
			}
			return target;
		},
		enumerable: false
	});
})();