Skip to content
Snippets Groups Projects
Commit 5366ba2b authored by Commander-lol's avatar Commander-lol
Browse files

Added simple JSON utilities

parent 24cdcb94
No related branches found
No related tags found
No related merge requests found
......@@ -76,6 +76,23 @@
}
}
tinyDOM.exists = function(obj){
return obj !== null && typeof(obj) !== 'undefined';
}
tinyDOM.merge = function(json1, json2){
if(!this.exists(json1) || !this.exists(json2)){
return null;
} else {
for(var prop in json2) {
if(json2.hasOwnProperty(prop)){
json1[prop] = json2[prop];
}
}
return json1;
}
}
if(!window.μ){
window.μ = tinyDOM;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment