varglobal=require('../internals/global');varcreateNonEnumerableProperty=require('../internals/create-non-enumerable-property');varhas=require('../internals/has');varsetGlobal=require('../internals/set-global');varinspectSource=require('../internals/inspect-source');varInternalStateModule=require('../internals/internal-state');vargetInternalState=InternalStateModule.get;varenforceInternalState=InternalStateModule.enforce;varTEMPLATE=String(String).split('String');(module.exports=function(O,key,value,options){varunsafe=options?!!options.unsafe:false;varsimple=options?!!options.enumerable:false;varnoTargetGet=options?!!options.noTargetGet:false;if(typeofvalue=='function'){if(typeofkey=='string'&&!has(value,'name'))createNonEnumerableProperty(value,'name',key);enforceInternalState(value).source=TEMPLATE.join(typeofkey=='string'?key:'');}if(O===global){if(simple)O[key]=value;elsesetGlobal(key,value);return;}elseif(!unsafe){deleteO[key];}elseif(!noTargetGet&&O[key]){simple=true;}if(simple)O[key]=value;elsecreateNonEnumerableProperty(O,key,value);// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative})(Function.prototype,'toString',functiontoString(){returntypeofthis=='function'&&getInternalState(this).source||inspectSource(this);});