1
0
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:
Jeremy Ruston 2012-12-14 13:30:10 +00:00
parent d338a54370
commit 28f96de225

View File

@ -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)) {