function exportPath(name, opt_object, opt_objectToExportTo) {
    let parts = name.split('.');
    let cur = opt_objectToExportTo || global;

    for (let part; parts.length && (part = parts.shift()); ) {
      if (!parts.length && opt_object !== undefined) {
        // last part and we have an object; use it
        cur[part] = opt_object;
      } else if (part in cur) {
        cur = cur[part];
      } else {
        cur = cur[part] = {};
      }
    }
    return cur;
  }
Builds an object structure for the provided namespace path,
ensuring that names that already exist are not overwritten. For
example:
"a.b.c" -> a = {};a.b={};a.b.c={};
@param {string} name Name of the object that this file defines.
@param {*=} opt_object The object to expose at the end of the path.
@param {Object=} opt_objectToExportTo The object to add the path to;
    default is {@code global}.
@private