code: function normalize(name, baseName) {
              var pkgName, pkgConfig;
  
              //Adjust any relative paths.
              if (name && name.charAt(0) === ".") {
                  //If have a base name, try to normalize against it,
                  //otherwise, assume it is a top-level require that will
                  //be relative to baseUrl in the end.
                  if (baseName) {
                      if (config.pkgs[baseName]) {
                          //If the baseName is a package name, then just treat it as one
                          //name to concat the name with.
                          baseName = [baseName];
                      } else {
                          //Convert baseName to array, and lop off the last part,
                          //so that . matches that "directory" and not name of the baseName's
                          //module. For instance, baseName of "one/two/three", maps to
                          //"one/two/three.js", but we want the directory, "one/two" for
                          //this normalization.
                          baseName = baseName.split("/");
                          baseName = baseName.slice(0, baseName.length - 1);
                      }
  
                      name = baseName.concat(name.split("/"));
                      trimDots(name);
  
                      //Some use of packages may use a . path to reference the
                      //"main" module name, so normalize for that.
                      pkgConfig = config.pkgs[(pkgName = name[0])];
                      name = name.join("/");
                      if (pkgConfig && name === pkgName + '/' + pkgConfig.main) {
                          name = pkgName;
                      }
                  } else if (name.indexOf("./") === 0) {
                      // No baseName, so this is ID is resolved relative
                      // to baseUrl, pull off the leading dot.
                      name = name.substring(2);
                  }
              }
              return name;
          }
docs: Given a relative module name, like ./something, normalize it to
  a real name that can be mapped to a path.
  @param {String} name the relative name
  @param {String} baseName a real name that the name arg is relative
  to.
  @returns {String} normalized name