You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
387 B
18 lines
387 B
5 years ago
|
|
||
|
/**
|
||
|
* 拓展对象
|
||
|
*/
|
||
|
exports.extend = function extend(target) {
|
||
|
var sources = Array.prototype.slice.call(arguments, 1);
|
||
|
|
||
|
for (var i = 0; i < sources.length; i += 1) {
|
||
|
var source = sources[i];
|
||
|
for (var key in source) {
|
||
|
if (source.hasOwnProperty(key)) {
|
||
|
target[key] = source[key];
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return target;
|
||
|
};
|