MCPcopy Create free account
hub / github.com/hoothin/UserScripts / cloneObject

Function cloneObject

Picviewer CE+/dist.user.js:13815–13828  ·  view source on GitHub ↗
(obj,deep)

Source from the content-addressed store, hash-verified

13813
13814 //对象克隆
13815 function cloneObject(obj,deep){
13816 var obj_i;
13817 var ret=Array.isArray(obj)? [] : {};
13818 for(var i in obj){
13819 if(!obj.hasOwnProperty(i))continue;
13820 obj_i=obj[i];
13821 if(!deep || typeof obj_i!='object' || obj_i===null || obj_i.nodeType){
13822 ret[i]=obj_i;
13823 }else{
13824 ret[i]=cloneObject(obj_i,deep);
13825 };
13826 };
13827 return ret;
13828 };
13829
13830 //闪烁元素。
13831 function flashEle(ele,duration){

Callers 2

initFunction · 0.70
openInTopFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected