Gets dependencies from the js source.
@param {string} jsSource Source.
@return {Object<string, string>} dependencies
18210
function getDependencies(jsSource) {
  const lines = jsSource.split('\n');
  const dependencies = {
    ol: pkg.version
  };
  for (let i = 0, ii = lines.length; i < ii; ++i) {
    const line = lines[i];
    const importMatch = line.match(importRegEx);
    if (importMatch) {
      const imp = importMatch[1];
      if (!imp.startsWith('ol/') && imp != 'ol') {
        const parts = imp.split('/');
        let dep;
        if (imp.startsWith('@')) {
          dep = parts.slice(0, 2).join('/');
        } else {
          dep = parts[0];
        }
        if (dep in pkg.devDependencies) {
          dependencies[dep] = pkg.devDependencies[dep];
        }
      }
    }
  }
  return dependencies;
}
867150
function resolveSources() {
  const sources = [
    ...resolveEnvSources('NODE_PATH'),
    ...resolveEnvSources('BROWSER_PATH'),
    // Get global path from npm config
    path.join(
      process.env.npm_config_prefix || exec('npm config get prefix', { encoding: 'utf8' }).replace('\n', ''),
      'lib/node_modules'
    )
  ];

  return unique(sources.map(source => path.resolve(source)));
}
367080
function buildDependantsSourceTree(sourceFileName, sourcesObject) {
  const depsTree = buildDependencyTreeFromSources(Object.keys(sourcesObject), sourcesObject);

  return buildFlatSourcesObjectFromTreeObject(depsTree[sourceFileName]);
}
907293
function lookForExternalDependenciesJS( _def, javascriptSources ) {
  if ( !_def ) return;
  try {
    const def = convertExternalDependencyDefinition( _def );
    Object.keys( def ).forEach( function ( js ) {
      const
      filename = `mod/${js}`,
      src = new Source( Project, filename ),
      code = src.read();
      pushUnique( javascriptSources, code );
    } );
  } catch ( ex ) {
    Fatal.fire(
      `Unable to parse JS dependencies: ${JSON.stringify(_def)}!\n${ex}`,
      javascriptSources
    );
  }
}
549491
function(dependencies) {
        var _dependencies = dependencies || {};
        var _numberOfOudatedPackages = Object.keys(_dependencies).length;
        var _minor = semver.allMinor(dependencies, 'latest');
        var _major = semver.allMajor(dependencies, 'latest');
        var _patch = semver.allPatch(dependencies, 'latest`');
        var _passing = (
          options['up-to-dateness'].number >= _numberOfOudatedPackages &&
          _major.passing === true &&
          _minor.passing === true &&
          _patch.passing === true
        );

        return {
          passing: _passing,
          outdated: _.merge(_major.outdated, _minor.outdated, _patch.outdated)
        };
      }
832425
private int getDependencies(JSONObject npmLsJson, List<String> linesOfNpmLs, int currentLineNumber, Collection<DependencyInfo> dependencies) {
        if (npmLsJson.has(Constants.DEPENDENCIES)) {
            JSONObject dependenciesJsonObject = npmLsJson.getJSONObject(Constants.DEPENDENCIES);
            if (dependenciesJsonObject != null) {
                for (int i = 0; i < dependenciesJsonObject.keySet().size(); i++) {
                    String currentLine = linesOfNpmLs.get(currentLineNumber);
                    // Examples:
                    // +-- UNMET DEPENDENCY @material-ui/core@1.5.0
                    // | +-- UNMET DEPENDENCY @babel/runtime@7.0.0-beta.42
                    // | | `-- UNMET DEPENDENCY regenerator-runtime@0.11.1
                    // |   | +-- UNMET OPTIONAL DEPENDENCY are-we-there-yet@1.1.4
                    // |   | | +-- UNMET OPTIONAL DEPENDENCY delegates@1.0.0
                    // |   | | `-- UNMET OPTIONAL DEPENDENCY readable-stream@2.3.6
                    if (currentLine.endsWith(DEDUPED) || currentLine.contains(UNMET_DEPENDENCY)) {
                        currentLineNumber++;
                        continue;
                    }
                    String dependencyAlias = getTheNextPackageNameFromNpmLs(currentLine);
                    try {
                        JSONObject dependencyJsonObject = dependenciesJsonObject.getJSONObject(dependencyAlias);
                        DependencyInfo dependency = getDependency(dependencyAlias, dependencyJsonObject);
                        if (dependency != null) {
                            dependencies.add(dependency);
                            logger.debug("Collect child dependencies of {}", dependencyAlias);
                            // collect child dependencies
                            Collection<DependencyInfo> childDependencies = new ArrayList<>();
                            currentLineNumber = getDependencies(dependencyJsonObject, linesOfNpmLs, currentLineNumber + 1, childDependencies);
                            dependency.getChildren().addAll(childDependencies);
                        } else {
                            // it can be only if was an error in 'npm ls'
                            if (dependencyJsonObject.has(REQUIRED)) {
                                Object requiredObject = dependencyJsonObject.get(REQUIRED);
                                if (requiredObject instanceof JSONObject) {
                                    currentLineNumber = getDependencies((JSONObject) requiredObject, linesOfNpmLs, currentLineNumber + 1, new ArrayList<>());
                                } else {
                                    currentLineNumber++;
                                }
                            } else {
                                currentLineNumber++;
                            }
                        }
                    } catch (JSONException e){
                        if (ignoreNpmLsErrors) {
                            logger.error(e.getMessage());
                            logger.debug("{}", e.getStackTrace());
                            currentLineNumber++;
                        } else {
                            throw e;
                        }
                    }
                }
            }
        }
        return currentLineNumber;
    }
1240665
function buildDependencyTreeFromSources(filenames, sourcesObject) {
  const orgnizedFlat = {};

  // build tree object
  filenames.forEach(sourceFileName => {
    orgnizedFlat[sourceFileName] = {
      path: sourceFileName,
      source: sourcesObject[sourceFileName],
      dependencies: buildDependencyTreeFromSources(allImportPaths(sourcesObject[sourceFileName]), sourcesObject),
    };
  });

  // return organized object
  return orgnizedFlat;
}
836826
function (requestObject) {
            var dependencies = [], appEnv = ariaModulesUrlServiceEnvironmentUrlService;
            if (!requestObject.urlService && !this._urlService) {
                var urlServiceCfg = appEnv.getUrlServiceCfg();
                dependencies.push(urlServiceCfg.implementation);
            }
            if (!requestObject.requestHandler && !this._requestHandler) {
                var requestHandlerCfg = ariaModulesRequestHandlerEnvironmentRequestHandler.getRequestHandlerCfg();
                dependencies.push(requestHandlerCfg.implementation);
            }
            return dependencies;
        }
672417
@Override
    public List<String> getDependencies() {
        List<String> dependencies = new ArrayList<String>();
        if (container.getSingle("dependencies") != null) {
            for (Node dep : container.getSingle("dependencies").get("dependency")) {
                dependencies.add(dep.getText());
            }
        }
        return dependencies;
    }
110382
async function getJSXConfig(asset, isSourceModule) {
  // Don't enable JSX in node_modules
  if (!isSourceModule) {
    return null;
  }

  let pkg = await asset.getPackage();

  // Find a dependency that we can map to a JSX pragma
  let pragma = null;
  for (let dep in JSX_PRAGMA) {
    if (
      pkg &&
      ((pkg.dependencies && pkg.dependencies[dep]) ||
        (pkg.devDependencies && pkg.devDependencies[dep]))
    ) {
      pragma = JSX_PRAGMA[dep];
      break;
    }
  }

  if (!pragma) {
    pragma = maybeCreateFallbackPragma(asset);
  }

  if (pragma || JSX_EXTENSIONS[path.extname(asset.name)]) {
    return {
      internal: true,
      babelVersion: 7,
      config: {
        plugins: [
          [
            require('@babel/plugin-transform-react-jsx'),
            {
              pragma,
              pragmaFrag: 'React.Fragment'
            }
          ]
        ]
      }
    };
  }
}
797727
def dependencies(self):
        
        result = []
        dependencies = javabridge.get_collection_wrapper(
            javabridge.call(self.jobject, "getDependencies", "()Ljava/util/List;"))
        for dependency in dependencies:
            result.append(Dependency(dependency))
        return result
330529
function getAllDependencies(allVariables, currentKey, dependencies = new Set()) {

    if (!allVariables[currentKey].dependencies.length) {

        dependencies.add(`${currentKey}: ${allVariables[currentKey].value}`);
        return Array.from(dependencies);
    } else {

        allVariables[currentKey].dependencies.forEach(dependecy => {
            getAllDependencies(allVariables, dependecy, dependencies).forEach(newDependency => dependencies.add(newDependency));
        });

        dependencies.add(`${currentKey}: ${allVariables[currentKey].value}`);
        return Array.from(dependencies);
    }
}
1177827
def dependencies(self):
        
        result = []
        iterator = javabridge.iterate_java(javabridge.call(self.jobject, "dependencies", "()Ljava/util/Iterator;"))
        for c in iterator:
            result.append(Capability(c))
        return result
86578
private static List<DependencyInfo> getDependencies(JsonReader reader) throws IOException {
        Gson gson = new Gson();
        List<DependencyInfo> dependencies = new ArrayList<>();
        reader.beginArray();
        while (reader.hasNext()) {
            DependencyInfo dependencyInfo = gson.fromJson(reader, DependencyInfo.class);
            dependencies.add(dependencyInfo);
        }
        reader.endArray();
        return dependencies;
    }
677498
function (dependencies) {
            this._dependsOn = dependencies[this._name] || [];
            this._dependencyOf = [];
            Object.keys(dependencies).forEach(function (name) {
                var nameDependencies = dependencies[name];
                if (nameDependencies.indexOf(this._name) !== NOT_FOUND) {
                    this._dependencyOf.push(name);
                }
            }, this);
        }
765483
function resolveDependencies(map) {
			var dependencyGraph = dependencies || {};
			var resolved = [];
			var unresolved = [];

			// Build dependency graph
			if (map.dependencies) {
				dependencyTools.buildDependencyGraph(
					undefined,  // First recursion without a start value
					map.dependencies,
					dependencyGraph
				);

				// Flatten/resolve the dependency tree
				dependencyTools.resolveDependencyGraph(
					undefined,  // First recursion without a start value
					resolved,
					unresolved,
					dependencyGraph
				);
			}

			return resolved;
		}
1318456
public static void loadScriptDependencies(final JsArrayString dependencies, final JavaScriptObject callback) {

        if (dependencies.length() == 0) {
            return;
        }
        final Set<String> absoluteUris = new HashSet<String>();
        for (int i = 0; i < dependencies.length(); i++) {
            absoluteUris.add(WidgetUtil.getAbsoluteUrl(dependencies.get(i)));
        }
        // Listener that loads the next when one is completed
        ResourceLoadListener resourceLoadListener = new ResourceLoadListener() {

            @Override
            public void onError(ResourceLoadEvent event) {

                CmsDebugLog.consoleLog(event.getResourceUrl() + " could not be loaded.");
                // The show must go on
                absoluteUris.remove(event.getResourceUrl());
                if (absoluteUris.isEmpty()) {
                    Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                        public void execute() {

                            callNativeFunction(callback);
                        }
                    });
                }

            }

            @Override
            public void onLoad(ResourceLoadEvent event) {

                absoluteUris.remove(event.getResourceUrl());
                if (absoluteUris.isEmpty()) {
                    Scheduler.get().scheduleDeferred(new ScheduledCommand() {

                        public void execute() {

                            callNativeFunction(callback);
                        }
                    });

                }
            }
        };

        ResourceLoader loader = ResourceLoader.get();
        for (int i = 0; i < dependencies.length(); i++) {
            String preloadUrl = dependencies.get(i);
            loader.loadScript(preloadUrl, resourceLoadListener);
        }
    }