删除 YouleNexus 内嵌 .git,统一由根仓库唯一管理。提交: - projects/ 旧 H5 模板 Game_Surface_3 与各子游戏源码 - cocoscreator_projects/YouleNexus 工程 + cocos-creator-mcp 扩展源码 - CLAUDE.md、.mcp.json 等配置 library/temp/node_modules/dist 等缓存由 .gitignore 排除。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
58 lines
1.0 KiB
JavaScript
58 lines
1.0 KiB
JavaScript
var module_util = module_util || {};
|
|
//判断是否为数组
|
|
module_util.isArray = function(o){
|
|
return Object.prototype.toString.call(o)=='[object Array]';
|
|
}
|
|
//拷贝数组
|
|
module_util.deepcopy = function(obj) {
|
|
var out = [],i = 0,len = obj.length;
|
|
for (; i < len; i++) {
|
|
if (obj[i] instanceof Array){
|
|
out[i] = module_util.deepcopy(obj[i]);
|
|
}
|
|
else out[i] = obj[i];
|
|
}
|
|
return out;
|
|
}
|
|
//对象克隆
|
|
module_util.clone = function(myObj){
|
|
if(typeof(myObj) != 'object') return myObj;
|
|
if(myObj == null) return myObj;
|
|
|
|
var myNewObj = new Object();
|
|
|
|
for(var i in myObj)
|
|
myNewObj[i] = module_util.clone(myObj[i]);
|
|
|
|
return myNewObj;
|
|
}
|
|
module_util.removeItemFromArray = function(_array,_id){
|
|
var index = _array.indexOf(_id);
|
|
if(index>-1){
|
|
var id = _array.splice(index,1);
|
|
return id;
|
|
}else{
|
|
return null;
|
|
}
|
|
}
|
|
module_util.submitError = function(_msg,error){
|
|
//console.log("submitError");
|
|
//console.log(_msg);
|
|
//console.log(error);
|
|
Net.submit_error(_msg,error);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|