Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function generateDepFileTextFromDeps(
dependencies: depGraph.Dependency[],
googBaseDir: string
): string {
// `getDepFileText()` doesn't generate addDependency() for SCRIPT,
// so change the type to CLOSURE_PROVIDE temporally.
// TODO: fix upstream google-closure-deps and remove this
const scriptDeps = dependencies.filter(dep => dep.type === depGraph.DependencyType.SCRIPT);
scriptDeps.forEach(dep => {
dep.type = depGraph.DependencyType.CLOSURE_PROVIDE;
});
const depFileText = depFile.getDepFileText(googBaseDir, dependencies);
// restore the type
scriptDeps.forEach(dep => {
dep.type = depGraph.DependencyType.SCRIPT;
});
return depFileText;
}