File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 1
- /// <reference types="node" />
2
-
3
1
import findProjectRoot = require( "find-project-root" ) ;
4
2
5
- const root : string | null = findProjectRoot ( process . cwd ( ) , {
6
- maxDepth : 12
3
+ const root : string | null = findProjectRoot ( "./" , {
4
+ maxDepth : 12 ,
5
+ } ) ;
6
+
7
+ findProjectRoot . MARKERS ; // $ExpectType [".git", ".hg"]
8
+ findProjectRoot . MAX_DEPTH ; // $ExpectType 9
9
+
10
+ // $ExpectType string | null
11
+ findProjectRoot ( "./" , {
12
+ maxDepth : findProjectRoot . MAX_DEPTH ,
13
+ markers : findProjectRoot . MARKERS ,
7
14
} ) ;
Original file line number Diff line number Diff line change 6
6
/**
7
7
* Finds the project root by custom markers
8
8
*/
9
- declare function findProjectRoot (
10
- path : string ,
11
- options ?: findProjectRoot . Options
12
- ) : null | string ;
9
+ declare function findProjectRoot ( path : string , options ?: findProjectRoot . Options ) : null | string ;
13
10
14
11
declare namespace findProjectRoot {
15
12
interface Options {
@@ -22,6 +19,9 @@ declare namespace findProjectRoot {
22
19
*/
23
20
markers ?: string [ ] ;
24
21
}
22
+
23
+ const MAX_DEPTH : 9 ;
24
+ const MARKERS : [ ".git" , ".hg" ] ;
25
25
}
26
26
27
27
export = findProjectRoot ;
You can’t perform that action at this time.
0 commit comments