lib/lib.js
function(ns, root){
    if (!ns) {
      return null;
    }
    var nsParts = ns.split(".");
    root = root || this;
    for (var i = 0, len = nsParts.length; i < len; i++) {
      if (typeof root[nsParts[i]] === "undefined") {
        root[nsParts[i]] = {};
      }
      root = root[nsParts[i]];
    }
    return root;
  }
function(ns, root){
    if (!ns) {
      return null;
    }
    var nsParts = ns.split(".");
    root = root || this;
    for (var i = 0, len = nsParts.length; i < len; i++) {
      if (typeof root[nsParts[i]] === "undefined") {
        root[nsParts[i]] = {};
      }
      root = root[nsParts[i]];
    }
    return root;
  }
function ( ns , root ) { if ( ! ns ) { return null ; } var nsParts = ns . split ( "." ) ; root = root || this ; for ( var i = 0 , len = nsParts . length ; i < len ; i ++ ) { if ( typeof root [ nsParts [ i ] ] === "undefined" ) { root [ nsParts [ i ] ] = { } ; } root = root [ nsParts [ i ] ] ; } return root ; }
define a namespace object
@param {Object} ns
define a namespace object