@commitlint/top-level
Advanced tools
+1
-1
@@ -5,3 +5,3 @@ export default toplevel; | ||
| */ | ||
| declare function toplevel(cwd?: string): Promise<string | undefined>; | ||
| declare function toplevel(cwd?: string): Promise<string | void>; | ||
| //# sourceMappingURL=index.d.ts.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,eAAe,QAAQ,CAAC;AAExB;;GAEG;AACH,iBAAe,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,+BAQnC"} | ||
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,eAAe,QAAQ,CAAC;AAExB;;GAEG;AACH,iBAAS,QAAQ,CAAC,GAAG,SAAgB,0BAMpC"} |
+8
-16
@@ -1,3 +0,3 @@ | ||
| import path from "node:path"; | ||
| import { findUp } from "find-up"; | ||
| import process from "node:process"; | ||
| import escalade from "escalade"; | ||
| export default toplevel; | ||
@@ -7,17 +7,9 @@ /** | ||
| */ | ||
| async function toplevel(cwd) { | ||
| const found = await searchDotGit(cwd); | ||
| if (typeof found !== "string") { | ||
| return found; | ||
| } | ||
| return path.join(found, ".."); | ||
| function toplevel(cwd = process.cwd()) { | ||
| return escalade(cwd, (directory, files) => { | ||
| if (files.includes(".git")) { | ||
| return directory; | ||
| } | ||
| }); | ||
| } | ||
| /** | ||
| * Search .git, the '.git' can be a file(submodule), also can be a directory(normal) | ||
| */ | ||
| async function searchDotGit(cwd) { | ||
| const foundFile = await findUp(".git", { cwd, type: "file" }); | ||
| const foundDir = await findUp(".git", { cwd, type: "directory" }); | ||
| return foundFile || foundDir; | ||
| } | ||
| //# sourceMappingURL=index.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,eAAe,QAAQ,CAAC;AAExB;;GAEG;AACH,KAAK,UAAU,QAAQ,CAAC,GAAY;IACnC,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,CAAC;IAEtC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,YAAY,CAAC,GAAY;IACvC,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;IAElE,OAAO,SAAS,IAAI,QAAQ,CAAC;AAC9B,CAAC"} | ||
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,eAAe,QAAQ,CAAC;AAExB;;GAEG;AACH,SAAS,QAAQ,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;IACpC,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE;QACzC,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YAC5B,OAAO,SAAS,CAAC;QAClB,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC"} |
+4
-4
| { | ||
| "name": "@commitlint/top-level", | ||
| "type": "module", | ||
| "version": "20.0.0", | ||
| "version": "20.4.0", | ||
| "description": "Lint your commit messages", | ||
@@ -39,8 +39,8 @@ "main": "lib/index.js", | ||
| "devDependencies": { | ||
| "@commitlint/utils": "^20.0.0" | ||
| "@commitlint/test": "^20.4.0" | ||
| }, | ||
| "dependencies": { | ||
| "find-up": "^7.0.0" | ||
| "escalade": "^3.2.0" | ||
| }, | ||
| "gitHead": "407be6c96b1a108ee012ed5330b0d80a165952d5" | ||
| "gitHead": "c68de5e24b010e38eac171f35ba18d31bb1fd3dd" | ||
| } |
3150
-15.53%18
-30.77%+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed