This commit is contained in:
welefen 2013-12-23 13:47:47 +08:00
parent 36ed283faf
commit 034e67daff

View File

@ -327,6 +327,14 @@ global.parse_name = function(name, type){
}).toLowerCase();
}
}
/**
* 判断是否是个promise
* @param {[type]} obj [description]
* @return {Boolean} [description]
*/
global.is_promise = function(obj){
return when.isPromise(obj);
}
/**
* 生成一个promise,如果传入的参数是promise则直接返回
* @param {[type]} obj [description]