lib/express-expose.js
function renderNamespace(str) {

  var parts = [];
  var split = str.split('.');
  var len = split.length;

  return str.split('.').map(function(part, i) {
    parts.push(part);
    part = parts.join('.');
    return (i ? '' : 'window.') + part + ' = window.' + part + ' || {};';
  }).join('\n');
}
function renderNamespace(str) {

  var parts = [];
  var split = str.split('.');
  var len = split.length;

  return str.split('.').map(function(part, i) {
    parts.push(part);
    part = parts.join('.');
    return (i ? '' : 'window.') + part + ' = window.' + part + ' || {};';
  }).join('\n');
}
function renderNamespace ( str ) { var parts = [ ] ; var split = str . split ( '.' ) ; var len = split . length ; return str . split ( '.' ) . map ( function ( part , i ) { parts . push ( part ) ; part = parts . join ( '.' ) ; return ( i ? '' : 'window.' ) + part + ' = window.' + part + ' || {};' ; } ) . join ( '\n' ) ; }
Render a namespace from the given `str`.

Examples:

renderNamespace('foo.bar.baz');

var foo = foo || {};
foo.bar = foo.bar || {};
foo.bar.baz = foo.bar.baz || {};

@param {String} str
@return {String}
@api private
Render a namespace from the given str .