Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
depGraph.DependencyType.CLOSURE_MODULE,
`${variousModulesFixturesDir}/closuremodule.js`,
["closuremodule"],
[new depGraph.GoogRequire("goog"), new depGraph.GoogRequire("goog.array")]
),
new depGraph.Dependency(
depGraph.DependencyType.CLOSURE_PROVIDE,
`${variousModulesFixturesDir}/closureprovide.js`,
["closureprovide"],
[new depGraph.GoogRequire("goog"), new depGraph.GoogRequire("goog.array")]
),
new depGraph.Dependency(
depGraph.DependencyType.ES6_MODULE,
`${variousModulesFixturesDir}/esm-moduleid.js`,
["esm"],
[new depGraph.Es6Import("./foo.js"), new depGraph.GoogRequire("goog")],
"es6"
),
new depGraph.Dependency(
depGraph.DependencyType.ES6_MODULE,
`${variousModulesFixturesDir}/esm.js`,
[],
[new depGraph.Es6Import("./foo.js")],
"es6"
),
new depGraph.Dependency(
depGraph.DependencyType.SCRIPT,
`${variousModulesFixturesDir}/script.js`,
[],
[new depGraph.GoogRequire("goog"), new depGraph.GoogRequire("goog.array")]
),
] as const;
depGraph.DependencyType.CLOSURE_MODULE,
`${variousModulesFixturesDir}/closuremodule.js`,
["closuremodule"],
[new depGraph.GoogRequire("goog"), new depGraph.GoogRequire("goog.array")]
),
new depGraph.Dependency(
depGraph.DependencyType.CLOSURE_PROVIDE,
`${variousModulesFixturesDir}/closureprovide.js`,
["closureprovide"],
[new depGraph.GoogRequire("goog"), new depGraph.GoogRequire("goog.array")]
),
new depGraph.Dependency(
depGraph.DependencyType.ES6_MODULE,
`${variousModulesFixturesDir}/esm-moduleid.js`,
["esm"],
[new depGraph.Es6Import("./foo.js"), new depGraph.GoogRequire("goog")],
"es6"
),
new depGraph.Dependency(
depGraph.DependencyType.ES6_MODULE,
`${variousModulesFixturesDir}/esm.js`,
[],
[new depGraph.Es6Import("./foo.js")],
"es6"
),
new depGraph.Dependency(
depGraph.DependencyType.SCRIPT,
`${variousModulesFixturesDir}/script.js`,
[],
[new depGraph.GoogRequire("goog"), new depGraph.GoogRequire("goog.array")]
),
] as const;
const imports = depData.imports.map(i => {
if (i.isEs6Import && !i.isGoogRequire) {
return new depGraph.Es6Import(i.symOrPath);
} else if (!i.isEs6Import && i.isGoogRequire) {
return new depGraph.GoogRequire(i.symOrPath);
} else {
throw new TypeError(`Unexpected import: ${i}`);
}
});
return new depGraph.Dependency(