mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-24 17:10:29 +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;
|
||||
};
|
||||
|
||||
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) {
|
||||
var result,t;
|
||||
if($tw.utils.isArray(object)) {
|
||||
|
Loading…
Reference in New Issue
Block a user