Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
dependenciesOf(moduleName: string): ResolvedDep[] {
let flatDeps: Map = new Map();
let deps = this.dependencies.get(moduleName);
if (deps) {
for (let dep of deps) {
if (dep.type === 'error') {
if (dep.hardFail) {
throw new Error(dep.message);
} else {
warn(dep.message);
}
} else {
for (let entry of dep.modules) {
let { runtimeName } = entry;
flatDeps.set(runtimeName, entry);
}
}
}
}
return [...flatDeps.values()];
}