How to use the google-closure-deps.depGraph.Es6Import function in google-closure-deps

To help you get started, we’ve selected a few google-closure-deps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github teppeis / duck / test / dependency-parser.ts View on Github external
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;
github teppeis / duck / test / gendeps.ts View on Github external
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;
github teppeis / duck / src / dependency-parser-wrapper.ts View on Github external
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(