Get the baseUrl of a compilerOptions object.

@param {Object} options
322346
function getAdditionalModulePaths(options = {}) {
  const baseUrl = options.baseUrl;

  // We need to explicitly check for null and undefined (and not a falsy value) because
  // TypeScript treats an empty string as `.`.
  if (baseUrl == null) {
    // If there's no baseUrl set we respect NODE_PATH
    // Note that NODE_PATH is deprecated and will be removed
    // in the next major release of create-react-app.

    const nodePath = process.env.NODE_PATH || '';
    return nodePath.split(path.delimiter).filter(Boolean);
  }

  const baseUrlResolved = path.resolve(paths.appPath, baseUrl);

  // We don't need to do anything if `baseUrl` is set to `node_modules`. This is
  // the default behavior.
  if (path.relative(paths.appNodeModules, baseUrlResolved) === '') {
    return null;
  }

  // Allow the user set the `baseUrl` to `appSrc`.
  if (path.relative(paths.appSrc, baseUrlResolved) === '') {
    return [paths.appSrc];
  }

  // Otherwise, throw an error.
  throw new Error(
    chalk.red.bold(
      "Your project's `baseUrl` can only be set to `src` or `node_modules`." +
        ' Create React App does not support other values at this time.'
    )
  );
}
207957
function parseOptions(options) {

  ttl = options.ttl || (3600 * 24); // cache for 1 day by default.
  tmpCacheTTL = options.tmpCacheTTL || 5; // small by default
  decodeFn = options.decodeFn || exports.decodeURL;
  presets  = options.presets || defaultPresets();

  tmpDir   = options.tmpDir || '/tmp/nodethumbnails';

  var rootPath = options.rootPath || '/thumbs';
  if (rootPath[0] === '/') { rootPath = rootPath.substring(1); } // be forgiving to user errors!

  var allowedExtensions = options.allowedExtensions || ['gif', 'png', 'jpg', 'jpeg'];
  for (var i=0; i < allowedExtensions.length; i++) {
    // be forgiving to user errors!
    if (allowedExtensions[i][0] === '.') {
      allowedExtensions[i] = allowedExtensions[i].substring(1);
    }
  }
  var szExtensions = allowedExtensions.join('|');

  // Example: http://example.com/thumbs/small/images/AB23DC16Hash.jpg
  regexp = new RegExp('^\/' + rootPath.replace(/\//ig, '\\/') +
    '\/([A-Za-z0-9_]+)\/images\/([%\.\-A-Za-z0-9_=\+]+)\.(?:' + szExtensions + ')$', 'i');
}
54701
function generateResourceListing(options) {
  var controllers = options.controllers;
  var opts = options.options || {};

  var listing = {
    openapi: '3.0.0',
    info: buildInfo(opts),
    servers: opts.servers || buildDefaultServers(),
    tags: buildTags(opts, controllers),
    paths: buildPaths(opts, controllers),
    components: buildComponents(opts, controllers)
  };

  mergeIn(listing.paths, opts.paths);

  if (opts.security) {
    listing.security = opts.security;
  }
  if (opts.externalDocs) {
    listing.externalDocs = opts.externalDocs;
  }

  return listing;
}
336028
function resolveSSLOptions(options) {
    var toReturn = _.clone(options);
    //Resolve the file-based properties
    _.forEach(_.keys(toReturn), function(key) {
        if (key === 'cert' || key === 'key' || key === 'pfx') {
            toReturn[key] = fs.readFileSync(path.resolve(global.__appDir, toReturn[key]));
        } else if (key === 'ca') { //this can be an array
            if (_.isArray(toReturn[key])) {
                //array
                toReturn[key] = _.map(toReturn[key], function(val) {
                    return fs.readFileSync(path.resolve(global.__appDir, val));
                });
            } else {
                //Single value
                toReturn[key] = fs.readFileSync(path.resolve(global.__appDir, toReturn[key]));
            }
        }
    });
    return toReturn;
}
1127694
function assetPath(url) {
  const parsedUrl = path.parse(url.getValue());
  return compiler.types.String('url("' + parsedUrl.base + '")');
}
1218088
function (tpl, option) {
            var code = compiler.compile(tpl);
            option = option || {};
            // eval is not ok for eval("(function(){})") ie
            return (Function.apply(null, []
                .concat(code.params)
                .concat(code.source.join('\n') + '//@ sourceURL=' +
                    (option.name ? option.name : ('xtemplate' + (xtemplateId++))) + '.js')));
        }
389251
function buildResolverOptions(options, base) {
  var pathFilter = options.pathFilter;

  options.basedir = base;
  options.pathFilter = function(info, resvPath, relativePath) {
    if (relativePath[0] !== '.') {
      relativePath = './' + relativePath;
    }
    var mappedPath;
    if (pathFilter) {
      mappedPath = pathFilter.apply(this, [info, resvPath, path.normalize(relativePath)]);
    }
    if (mappedPath) {
      return mappedPath;
    }
    return;
  };
  return options;
}
732839
function generateTSConfig(options, fileNames) {
        var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);
        var configurations = {
            compilerOptions: serializeCompilerOptions(compilerOptions)
        };
        if (fileNames && fileNames.length) {
            // only set the files property if we have at least one file
            configurations.files = fileNames;
        }
        return configurations;
        function getCustomTypeMapOfCommandLineOption(optionDefinition) {
            if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") {
                // this is of a type CommandLineOptionOfPrimitiveType
                return undefined;
            }
            else if (optionDefinition.type === "list") {
                return getCustomTypeMapOfCommandLineOption(optionDefinition.element);
            }
            else {
                return optionDefinition.type;
            }
        }
        function getNameOfCompilerOptionValue(value, customTypeMap) {
            // There is a typeMap associated with this command-line option so use it to map value back to its name
            for (var key in customTypeMap) {
                if (customTypeMap[key] === value) {
                    return key;
                }
            }
            return undefined;
        }
        function serializeCompilerOptions(options) {
            var result = ts.createMap();
            var optionsNameMap = getOptionNameMap().optionNameMap;
            for (var name_35 in options) {
                if (ts.hasProperty(options, name_35)) {
                    // tsconfig only options cannot be specified via command line,
                    // so we can assume that only types that can appear here string | number | boolean
                    switch (name_35) {
                        case "init":
                        case "watch":
                        case "version":
                        case "help":
                        case "project":
                            break;
                        default:
                            var value = options[name_35];
                            var optionDefinition = optionsNameMap[name_35.toLowerCase()];
                            if (optionDefinition) {
                                var customTypeMap = getCustomTypeMapOfCommandLineOption(optionDefinition);
                                if (!customTypeMap) {
                                    // There is no map associated with this compiler option then use the value as-is
                                    // This is the case if the value is expect to be string, number, boolean or list of string
                                    result[name_35] = value;
                                }
                                else {
                                    if (optionDefinition.type === "list") {
                                        var convertedValue = [];
                                        for (var _i = 0, _a = value; _i < _a.length; _i++) {
                                            var element = _a[_i];
                                            convertedValue.push(getNameOfCompilerOptionValue(element, customTypeMap));
                                        }
                                        result[name_35] = convertedValue;
                                    }
                                    else {
                                        // There is a typeMap associated with this command-line option so use it to map value back to its name
                                        result[name_35] = getNameOfCompilerOptionValue(value, customTypeMap);
                                    }
                                }
                            }
                            break;
                    }
                }
            }
            return result;
        }
    }
1256385
function getConfig(context, options, extendsDefaults) {
  const defaults = getDefaults(context, options);
  const config = $.config(options, defaults, (typeof extendsDefaults !== `boolean`) || extendsDefaults);
  config.metadata = { global: config.metadata, collections: {
    'error-pages': {
      pattern: `**/{500,404}.*`,
      metadata: {
        permalink: false
      }
    }
  }};
  return config;
}
1242823
function setBaseUrl(projectBaseUrl) {
        var context = _getProjectViewStateContext();

        projectBaseUrl = model.setBaseUrl(projectBaseUrl);

        PreferencesManager.setViewState("project.baseUrl", projectBaseUrl, context);
    }
880573
function getOptions(loaderContext) {
    const config = loaderContext.rootContext['angularGettextExtractLoader'];
    const query = loaderUtils.getOptions(loaderContext);
    // Need polyfill for IE, you could replace it back to lodash _({}, ..)
    const options = Object.assign({}, config, query);

    // Parse `extensions` option. Allows for custom file schemes.
    if (typeof options.extensions === 'string') {
        options.extensions = JSON.parse(options.extensions);
    }

    if (!options.pofile) {
        options.pofile = 'template.pot';
    }

    return options;
}
99858
function determineBaseURL(url) {

	var baseURL;

	// Check if url is set
	if (url) {

		// Remove whitespace
		baseURL = url.trim();

		baseURL = correctHttpAndHttps(baseURL);
		baseURL = correctQuestionMarkAndAnd(baseURL);
		baseURL = removeParameters(baseURL);

	} else {
		// Throw error (no url)
		throw new Error('The url parameter is not set.');
	}

	return baseURL;
}
711611
function createOptions( options ) {
    var object = optionsCache[ options ] = {};
    _each( options.split( /\s+/ ), function( flag ) {
      object[ flag ] = true;
    });
    return object;
  }
274548
function genPugSourceMap (filename, compiled, options) {
  options = options || {}

  const basedir = options.root ? path.resolve(path.normalize(options.root)) : process.cwd()
  filename = path.resolve(basedir, path.normalize(filename))

  const reLineAndPath = /;pug_debug_line = ([0-9]+);pug_debug_filename = "([^"]*)";/
  const reEntryPoint  = /^function [$\w]+\(locals\)\{var pug_html\s*=/
  const compiledLines = compiled.split('\n')
  const debugSources  = extractSources(compiledLines)
  const matchedFiles  = {}
  let lineCount = 0
  let lastLine = -1

  if (!debugSources) {
    throw new Error('Cannot get the source code. Please compile with compileDebug:true.')
  }

  const mapGenerator = new SourceMapGenerator({
    file: relative(basedir, filename) + '.js',
  })

  // allow breakpoints in 1st line, better support is in To Do
  if (reEntryPoint.test(compiledLines[0])) {
    mapGenerator.addMapping({
      generated: { line: 1, column: 0 },
      original: { line: 1, column: 0 },
      source: relative(basedir, filename),
    })
  }

  compiledLines.forEach((line, lineno) => {
    lineCount++

    const match = line.match(reLineAndPath)
    if (!match) {
      return
    }

    const originalLine = ~~match[1]
    if (originalLine <= 0) {
      return
    }

    // avoid normalize the path here to match the name in debugSources
    const fname = match[2] && match[2].replace(/\\u002F/g, '/').replace(/\\\\/g, '\\') || filename

    let matchedLines = matchedFiles[fname]
    if (!matchedLines) {
      // new included file - add source content
      matchedFiles[fname] = matchedLines = []

      if (!options.excludeContent) {
        addSourceContent(mapGenerator, basedir, fname, debugSources)
      }
    }

    // remove pug debug line from generated code, adjust line counter
    if (!options.keepDebugLines) {
      const len = match[0].length

      compiledLines[lineno] = line.length === len
        ? '' : line.slice(0, match.index) + line.slice(match.index + len)
      if (!compiledLines[lineno].trim()) {
        compiledLines[lineno] = '\0'
        lineCount--
      }
    }

    // have a recognized generated line?
    if (!/^;pug_debug/.test(compiledLines[lineno + 1])) {
      let generatedLine = lineCount + 1

      lastLine = lineno + 1
      if (compiledLines[lastLine].slice(0, 2) === '//' &&
          compiledLines[lastLine + 1] === ';(function(){') {
        generatedLine++
        lastLine++
      }

      // adds the new mapping if line is not matched yet
      if (matchedLines.indexOf(originalLine) < 0) {
        matchedLines.push(originalLine)
        mapGenerator.addMapping({
          generated: {
            line: generatedLine,
            column: 0,
          },
          original: {
            line: originalLine,
            column: 0,
          },
          source: relative(basedir, fname),
        })
      }
    }
  })

  // use the resulting non-empty lines to recreate the code
  if (!options.keepDebugLines) {

    // split the last row having the root catch clause
    if (~lastLine) {
      const line = compiledLines[lastLine]
      const pos = line.lastIndexOf(';}.call(this,') + 1
      if (pos && line.lastIndexOf('rethrow(err,') > pos) {
        compiledLines[lastLine] = line.slice(0, pos) + '\n' + line.slice(pos)
      }
    }

    compiled = compiledLines.filter((line) => line !== '\0').join('\n')
  }

  return { data: compiled, map: mapGenerator.toJSON() }
}
1224317
def get_src_path(self, obj, append_base=True):
        
        path = getsourcefile(obj)
        if self.src_root not in path:
            # this can happen with e.g.
            # inlinefunc-wrapped functions
            if hasattr(obj, "__module__"):
                path = "%s.%s" % (obj.__module__, obj.__name__)
            else:
                path = obj.__name__
            path = path.replace(".", "/")
        pre, post = path.rsplit(self.src_root + "/", 1)

        lineno = self.get_line_no(obj)
        lineno = "" if lineno is None else "#L{}".format(lineno)

        path = self.src_root + "/" + post + lineno
        if append_base:
            path = os.path.join(self.github_link, path)
        return path
581701
function(serverUrl) {
  var parsedUrl = url.parse(serverUrl);
  if (!parsedUrl.hostname) {
    throw new Error('Invalid server URL: ' + serverUrl);
  }

  /**
   * Base options for each request.
   * @private {!Object}
   */
  this.options_ = {
    host: parsedUrl.hostname,
    path: parsedUrl.pathname,
    port: parsedUrl.port
  };
}
45507
function extendDefaultOptions(options) {
  return Object.assign({
    dir: DEFAULT_DIRECTORY,
    extensions: DEFAULT_EXTENSIONS,
    params: DEFAULT_PARAMS
  }, options);
}