projects
/
platform
/
framework
/
web
/
crosswalk-tizen.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
7ed65db8c5ff5a16d807c58975296343b8ee242c
[platform/framework/web/crosswalk-tizen.git]
/
1
define(['../array/forEach'], function (forEach) {
2
3
/**
4
* Create nested object if non-existent
5
*/
6
function namespace(obj, path){
7
if (!path) return obj;
8
forEach(path.split('.'), function(key){
9
if (!obj[key]) {
10
obj[key] = {};
11
}
12
obj = obj[key];
13
});
14
return obj;
15
}
16
17
return namespace;
18
19
});