MCPcopy Create free account
hub / github.com/conventional-changelog/commitlint / dynamicImport

Function dynamicImport

@commitlint/cli/src/cli.ts:30–33  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

28const __dirname = path.resolve(fileURLToPath(import.meta.url), "..");
29
30const dynamicImport = async <T>(id: string): Promise<T> => {
31 const imported = await import(path.isAbsolute(id) ? pathToFileURL(id).toString() : id);
32 return ("default" in imported && imported.default) || imported;
33};
34
35const pkg: typeof import("../package.json") = require("../package.json");
36

Callers 1

loadFormatterFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected