mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-24 02:27:19 +00:00
Added extend() utility function
This commit is contained in:
parent
d338a54370
commit
28f96de225
@ -82,6 +82,17 @@ exports.checkDependencies = function(dependencies,changes) {
|
|||||||
return hit;
|
return hit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exports.extend = function(object /* [, src] */) {
|
||||||
|
$tw.utils.each(Array.prototype.slice.call(arguments, 1), function(source) {
|
||||||
|
if(source) {
|
||||||
|
for(var property in source) {
|
||||||
|
object[property] = source[property];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return object;
|
||||||
|
};
|
||||||
|
|
||||||
exports.deepCopy = function(object) {
|
exports.deepCopy = function(object) {
|
||||||
var result,t;
|
var result,t;
|
||||||
if($tw.utils.isArray(object)) {
|
if($tw.utils.isArray(object)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user