parseDependencyResult = function(
    closureRelativePath, providesText, requiresText, optionsText) {
  const provides = JSON.parse(providesText.replace(/'/g, '"'));
  const requires = JSON.parse(requiresText.replace(/'/g, '"'));
  const options = optionsText ? JSON.parse(optionsText.replace(/'/g, '"')) : {};

  let type = depGraph.DependencyType.SCRIPT;

  if (provides.length) {
    type = depGraph.DependencyType.CLOSURE_PROVIDE;
  }

  // true and false are legacy flags that mean a goog.module or not.
  if (options === true) {
    type = depGraph.DependencyType.CLOSURE_MODULE;
  } else if (options !== false) {
    switch (options.module) {
      case 'es6':
        type = depGraph.DependencyType.ES6_MODULE;
        break;
      case 'goog':
        type = depGraph.DependencyType.CLOSURE_MODULE;
        break;
      default:
        break;
    }
  }

  const imports = requires.map(
      // Assume if there is a slash it is an ES import, otherwise
      // goog.require. Any import should have a slash, except for those inside
      // the root of Closure Library (so just goog.js, which we also need to
      // check for). Admittedly not 100% accurate.
      (require) => require.indexOf('/') > -1 || require === 'goog.js' ?
          new depGraph.Es6Import(require) :
          new depGraph.GoogRequire(require));

  return new depGraph.ParsedDependency(
      type, closureRelativePath, provides, imports, options.lang);
}
@param {string} closureRelativePath
@param {string} providesText
@param {string} requiresText
@param {string} optionsText
@return {!depGraph.Dependency}