MCPcopy
hub / github.com/di-sukharev/opencommit / getCommitLintPWDConfig

Function getCommitLintPWDConfig

out/cli.cjs:85094–85110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85092 const packageFile = "@commitlint/load/package.json";
85093 const packageJsonPath = findModulePath(packageFile);
85094 const packageJson = JSON.parse(await import_promises.default.readFile(packageJsonPath, "utf8"));
85095 if (!packageJson) {
85096 throw new Error(`Failed to parse ${packageFile}`);
85097 }
85098 return packageJson.type === "module" ? "esm" : "cjs";
85099};
85100var getCommitLintPWDConfig = async () => {
85101 let load, modulePath;
85102 switch (await getCommitLintModuleType()) {
85103 case "cjs":
85104 modulePath = findModulePath("@commitlint/load");
85105 load = require(modulePath).default;
85106 break;
85107 case "esm":
85108 modulePath = findModulePath("@commitlint/load/lib/load.js");
85109 load = (await import(modulePath)).default;
85110 break;
85111 }
85112 if (load && typeof load === "function") {
85113 return await load();

Callers 1

Calls 3

loadFunction · 0.85
getCommitLintModuleTypeFunction · 0.70
findModulePathFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…