@@ -3,6 +3,7 @@ import {findUp, findUpSync, findUpMultiple, findUpMultipleSync, findUpStop, path
3
3
4
4
expectType < Promise < string | undefined > > ( findUp ( 'unicorn.png' ) ) ;
5
5
expectType < Promise < string | undefined > > ( findUp ( 'unicorn.png' , { cwd : '' } ) ) ;
6
+ expectType < Promise < string | undefined > > ( findUp ( 'unicorn.png' , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
6
7
expectType < Promise < string | undefined > > ( findUp ( [ 'rainbow.png' , 'unicorn.png' ] ) ) ;
7
8
expectType < Promise < string | undefined > > ( findUp ( [ 'rainbow.png' , 'unicorn.png' ] , { cwd : '' } ) ) ;
8
9
expectType < Promise < string | undefined > > ( findUp ( [ 'rainbow.png' , 'unicorn.png' ] , { allowSymlinks : true } ) ) ;
@@ -14,20 +15,23 @@ expectError(findUp(['rainbow.png', 'unicorn.png'], {concurrency: 1}));
14
15
15
16
expectType < Promise < string | undefined > > ( findUp ( ( ) => 'unicorn.png' ) ) ;
16
17
expectType < Promise < string | undefined > > ( findUp ( ( ) => 'unicorn.png' , { cwd : '' } ) ) ;
18
+ expectType < Promise < string | undefined > > ( findUp ( ( ) => 'unicorn.png' , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
17
19
expectType < Promise < string | undefined > > ( findUp ( ( ) => 'unicorn.png' , { allowSymlinks : true } ) ) ;
18
20
expectType < Promise < string | undefined > > ( findUp ( ( ) => 'unicorn.png' , { allowSymlinks : false } ) ) ;
19
21
expectType < Promise < string | undefined > > ( findUp ( ( ) => 'unicorn.png' , { type : 'file' } ) ) ;
20
22
expectType < Promise < string | undefined > > ( findUp ( ( ) => 'unicorn.png' , { type : 'directory' } ) ) ;
21
23
expectType < Promise < string | undefined > > ( findUp ( ( ) => 'unicorn.png' , { stopAt : 'foo' } ) ) ;
22
24
expectType < Promise < string | undefined > > ( findUp ( ( ) => undefined ) ) ;
23
25
expectType < Promise < string | undefined > > ( findUp ( ( ) => undefined , { cwd : '' } ) ) ;
26
+ expectType < Promise < string | undefined > > ( findUp ( ( ) => undefined , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
24
27
expectType < Promise < string | undefined > > ( findUp ( ( ) => undefined , { allowSymlinks : true } ) ) ;
25
28
expectType < Promise < string | undefined > > ( findUp ( ( ) => undefined , { allowSymlinks : false } ) ) ;
26
29
expectType < Promise < string | undefined > > ( findUp ( ( ) => undefined , { type : 'file' } ) ) ;
27
30
expectType < Promise < string | undefined > > ( findUp ( ( ) => undefined , { type : 'directory' } ) ) ;
28
31
expectType < Promise < string | undefined > > ( findUp ( ( ) => undefined , { stopAt : 'foo' } ) ) ;
29
32
expectType < Promise < string | undefined > > ( findUp ( ( ) : typeof findUpStop => findUpStop ) ) ;
30
33
expectType < Promise < string | undefined > > ( findUp ( ( ) : typeof findUpStop => findUpStop , { cwd : '' } ) ) ;
34
+ expectType < Promise < string | undefined > > ( findUp ( ( ) : typeof findUpStop => findUpStop , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
31
35
expectType < Promise < string | undefined > > ( findUp ( ( ) : typeof findUpStop => findUpStop , { stopAt : 'foo' } ) ) ;
32
36
expectType < Promise < string | undefined > > ( findUp ( async ( ) => 'unicorn.png' ) ) ;
33
37
expectType < Promise < string | undefined > > ( findUp ( async ( ) => 'unicorn.png' , { cwd : '' } ) ) ;
@@ -38,6 +42,7 @@ expectType<Promise<string | undefined>>(findUp(async () => 'unicorn.png', {type:
38
42
expectType < Promise < string | undefined > > ( findUp ( async ( ) => 'unicorn.png' , { stopAt : 'foo' } ) ) ;
39
43
expectType < Promise < string | undefined > > ( findUp ( async ( ) => undefined ) ) ;
40
44
expectType < Promise < string | undefined > > ( findUp ( async ( ) => undefined , { cwd : '' } ) ) ;
45
+ expectType < Promise < string | undefined > > ( findUp ( async ( ) => undefined , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
41
46
expectType < Promise < string | undefined > > ( findUp ( async ( ) => undefined , { allowSymlinks : true } ) ) ;
42
47
expectType < Promise < string | undefined > > ( findUp ( async ( ) => undefined , { allowSymlinks : false } ) ) ;
43
48
expectType < Promise < string | undefined > > ( findUp ( async ( ) => undefined , { type : 'file' } ) ) ;
@@ -46,6 +51,7 @@ expectType<Promise<string | undefined>>(findUp(async () => undefined, {stopAt: '
46
51
47
52
expectType < Promise < string | undefined > > ( findUp ( async ( ) : Promise < typeof findUpStop > => findUpStop ) ) ;
48
53
expectType < Promise < string | undefined > > ( findUp ( async ( ) : Promise < typeof findUpStop > => findUpStop , { cwd : '' } ) ) ;
54
+ expectType < Promise < string | undefined > > ( findUp ( async ( ) : Promise < typeof findUpStop > => findUpStop , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
49
55
expectType < Promise < string | undefined > > ( findUp ( async ( ) : Promise < typeof findUpStop > => findUpStop , { allowSymlinks : true } ) ) ;
50
56
expectType < Promise < string | undefined > > ( findUp ( async ( ) : Promise < typeof findUpStop > => findUpStop , { allowSymlinks : false } ) ) ;
51
57
expectType < Promise < string | undefined > > ( findUp ( async ( ) : Promise < typeof findUpStop > => findUpStop , { type : 'file' } ) ) ;
@@ -54,8 +60,10 @@ expectType<Promise<string | undefined>>(findUp(async (): Promise<typeof findUpSt
54
60
55
61
expectType < Promise < string [ ] > > ( findUpMultiple ( 'unicorn.png' ) ) ;
56
62
expectType < Promise < string [ ] > > ( findUpMultiple ( 'unicorn.png' , { cwd : '' } ) ) ;
63
+ expectType < Promise < string [ ] > > ( findUpMultiple ( 'unicorn.png' , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
57
64
expectType < Promise < string [ ] > > ( findUpMultiple ( [ 'rainbow.png' , 'unicorn.png' ] ) ) ;
58
65
expectType < Promise < string [ ] > > ( findUpMultiple ( [ 'rainbow.png' , 'unicorn.png' ] , { cwd : '' } ) ) ;
66
+ expectType < Promise < string [ ] > > ( findUpMultiple ( [ 'rainbow.png' , 'unicorn.png' ] , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
59
67
expectType < Promise < string [ ] > > ( findUpMultiple ( [ 'rainbow.png' , 'unicorn.png' ] , { allowSymlinks : true } ) ) ;
60
68
expectType < Promise < string [ ] > > ( findUpMultiple ( [ 'rainbow.png' , 'unicorn.png' ] , { allowSymlinks : false } ) ) ;
61
69
expectType < Promise < string [ ] > > ( findUpMultiple ( [ 'rainbow.png' , 'unicorn.png' ] , { type : 'file' } ) ) ;
@@ -65,30 +73,35 @@ expectError(findUpMultiple(['rainbow.png', 'unicorn.png'], {concurrency: 1}));
65
73
66
74
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => 'unicorn.png' ) ) ;
67
75
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => 'unicorn.png' , { cwd : '' } ) ) ;
76
+ expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => 'unicorn.png' , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
68
77
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => 'unicorn.png' , { allowSymlinks : true } ) ) ;
69
78
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => 'unicorn.png' , { allowSymlinks : false } ) ) ;
70
79
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => 'unicorn.png' , { type : 'file' } ) ) ;
71
80
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => 'unicorn.png' , { type : 'directory' } ) ) ;
72
81
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => 'unicorn.png' , { stopAt : 'foo' } ) ) ;
73
82
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => undefined ) ) ;
74
83
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => undefined , { cwd : '' } ) ) ;
84
+ expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => undefined , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
75
85
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => undefined , { allowSymlinks : true } ) ) ;
76
86
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => undefined , { allowSymlinks : false } ) ) ;
77
87
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => undefined , { type : 'file' } ) ) ;
78
88
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => undefined , { type : 'directory' } ) ) ;
79
89
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) => undefined , { stopAt : 'foo' } ) ) ;
80
90
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) : typeof findUpStop => findUpStop ) ) ;
81
91
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) : typeof findUpStop => findUpStop , { cwd : '' } ) ) ;
92
+ expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) : typeof findUpStop => findUpStop , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
82
93
expectType < Promise < string [ ] > > ( findUpMultiple ( ( ) : typeof findUpStop => findUpStop , { stopAt : 'foo' } ) ) ;
83
94
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => 'unicorn.png' ) ) ;
84
95
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => 'unicorn.png' , { cwd : '' } ) ) ;
96
+ expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => 'unicorn.png' , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
85
97
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => 'unicorn.png' , { allowSymlinks : true } ) ) ;
86
98
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => 'unicorn.png' , { allowSymlinks : false } ) ) ;
87
99
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => 'unicorn.png' , { type : 'file' } ) ) ;
88
100
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => 'unicorn.png' , { type : 'directory' } ) ) ;
89
101
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => 'unicorn.png' , { stopAt : 'foo' } ) ) ;
90
102
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => undefined ) ) ;
91
103
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => undefined , { cwd : '' } ) ) ;
104
+ expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => undefined , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
92
105
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => undefined , { allowSymlinks : true } ) ) ;
93
106
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => undefined , { allowSymlinks : false } ) ) ;
94
107
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) => undefined , { type : 'file' } ) ) ;
@@ -97,6 +110,7 @@ expectType<Promise<string[]>>(findUpMultiple(async () => undefined, {stopAt: 'fo
97
110
98
111
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) : Promise < typeof findUpStop > => findUpStop ) ) ;
99
112
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) : Promise < typeof findUpStop > => findUpStop , { cwd : '' } ) ) ;
113
+ expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) : Promise < typeof findUpStop > => findUpStop , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
100
114
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) : Promise < typeof findUpStop > => findUpStop , { allowSymlinks : true } ) ) ;
101
115
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) : Promise < typeof findUpStop > => findUpStop , { allowSymlinks : false } ) ) ;
102
116
expectType < Promise < string [ ] > > ( findUpMultiple ( async ( ) : Promise < typeof findUpStop > => findUpStop , { type : 'file' } ) ) ;
@@ -105,8 +119,10 @@ expectType<Promise<string[]>>(findUpMultiple(async (): Promise<typeof findUpStop
105
119
106
120
expectType < string | undefined > ( findUpSync ( 'unicorn.png' ) ) ;
107
121
expectType < string | undefined > ( findUpSync ( 'unicorn.png' , { cwd : '' } ) ) ;
122
+ expectType < string | undefined > ( findUpSync ( 'unicorn.png' , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
108
123
expectType < string | undefined > ( findUpSync ( [ 'rainbow.png' , 'unicorn.png' ] ) ) ;
109
124
expectType < string | undefined > ( findUpSync ( [ 'rainbow.png' , 'unicorn.png' ] , { cwd : '' } ) ) ;
125
+ expectType < string | undefined > ( findUpSync ( [ 'rainbow.png' , 'unicorn.png' ] , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
110
126
expectType < string | undefined > ( findUpSync ( [ 'rainbow.png' , 'unicorn.png' ] , { allowSymlinks : true } ) ) ;
111
127
expectType < string | undefined > ( findUpSync ( [ 'rainbow.png' , 'unicorn.png' ] , { allowSymlinks : false } ) ) ;
112
128
expectType < string | undefined > ( findUpSync ( [ 'rainbow.png' , 'unicorn.png' ] , { type : 'file' } ) ) ;
@@ -115,49 +131,57 @@ expectType<string | undefined>(findUpSync(['rainbow.png', 'unicorn.png'], {stopA
115
131
116
132
expectType < string | undefined > ( findUpSync ( ( ) => 'unicorn.png' ) ) ;
117
133
expectType < string | undefined > ( findUpSync ( ( ) => 'unicorn.png' , { cwd : '' } ) ) ;
134
+ expectType < string | undefined > ( findUpSync ( ( ) => 'unicorn.png' , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
118
135
expectType < string | undefined > ( findUpSync ( ( ) => 'unicorn.png' , { allowSymlinks : true } ) ) ;
119
136
expectType < string | undefined > ( findUpSync ( ( ) => 'unicorn.png' , { allowSymlinks : false } ) ) ;
120
137
expectType < string | undefined > ( findUpSync ( ( ) => 'unicorn.png' , { type : 'file' } ) ) ;
121
138
expectType < string | undefined > ( findUpSync ( ( ) => 'unicorn.png' , { type : 'directory' } ) ) ;
122
139
expectType < string | undefined > ( findUpSync ( ( ) => 'unicorn.png' , { stopAt : 'foo' } ) ) ;
123
140
expectType < string | undefined > ( findUpSync ( ( ) => undefined ) ) ;
124
141
expectType < string | undefined > ( findUpSync ( ( ) => undefined , { cwd : '' } ) ) ;
142
+ expectType < string | undefined > ( findUpSync ( ( ) => undefined , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
125
143
expectType < string | undefined > ( findUpSync ( ( ) => undefined , { allowSymlinks : true } ) ) ;
126
144
expectType < string | undefined > ( findUpSync ( ( ) => undefined , { allowSymlinks : false } ) ) ;
127
145
expectType < string | undefined > ( findUpSync ( ( ) => undefined , { type : 'file' } ) ) ;
128
146
expectType < string | undefined > ( findUpSync ( ( ) => undefined , { type : 'directory' } ) ) ;
129
147
expectType < string | undefined > ( findUpSync ( ( ) => undefined , { stopAt : 'foo' } ) ) ;
130
148
expectType < string | undefined > ( findUpSync ( ( ) : typeof findUpStop => findUpStop ) ) ;
131
149
expectType < string | undefined > ( findUpSync ( ( ) : typeof findUpStop => findUpStop , { cwd : '' } ) ) ;
150
+ expectType < string | undefined > ( findUpSync ( ( ) : typeof findUpStop => findUpStop , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
132
151
expectType < string | undefined > ( findUpSync ( ( ) : typeof findUpStop => findUpStop , { type : 'file' } ) ) ;
133
152
expectType < string | undefined > ( findUpSync ( ( ) : typeof findUpStop => findUpStop , { type : 'directory' } ) ) ;
134
153
expectType < string | undefined > ( findUpSync ( ( ) : typeof findUpStop => findUpStop , { stopAt : 'foo' } ) ) ;
135
154
136
155
expectType < string [ ] > ( findUpMultipleSync ( 'unicorn.png' ) ) ;
137
156
expectType < string [ ] > ( findUpMultipleSync ( 'unicorn.png' , { cwd : '' } ) ) ;
157
+ expectType < string [ ] > ( findUpMultipleSync ( 'unicorn.png' , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
138
158
expectType < string [ ] > ( findUpMultipleSync ( [ 'rainbow.png' , 'unicorn.png' ] ) ) ;
139
159
expectType < string [ ] > ( findUpMultipleSync ( [ 'rainbow.png' , 'unicorn.png' ] , { cwd : '' } ) ) ;
160
+ expectType < string [ ] > ( findUpMultipleSync ( [ 'rainbow.png' , 'unicorn.png' ] , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
140
161
expectType < string [ ] > ( findUpMultipleSync ( [ 'rainbow.png' , 'unicorn.png' ] , { allowSymlinks : true } ) ) ;
141
162
expectType < string [ ] > ( findUpMultipleSync ( [ 'rainbow.png' , 'unicorn.png' ] , { allowSymlinks : false } ) ) ;
142
163
expectType < string [ ] > ( findUpMultipleSync ( [ 'rainbow.png' , 'unicorn.png' ] , { type : 'file' } ) ) ;
143
164
expectType < string [ ] > ( findUpMultipleSync ( [ 'rainbow.png' , 'unicorn.png' ] , { type : 'directory' } ) ) ;
144
165
expectType < string [ ] > ( findUpMultipleSync ( [ 'rainbow.png' , 'unicorn.png' ] , { stopAt : 'foo' } ) ) ;
145
166
expectType < string [ ] > ( findUpMultipleSync ( ( ) => 'unicorn.png' ) ) ;
146
167
expectType < string [ ] > ( findUpMultipleSync ( ( ) => 'unicorn.png' , { cwd : '' } ) ) ;
168
+ expectType < string [ ] > ( findUpMultipleSync ( ( ) => 'unicorn.png' , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
147
169
expectType < string [ ] > ( findUpMultipleSync ( ( ) => 'unicorn.png' , { allowSymlinks : true } ) ) ;
148
170
expectType < string [ ] > ( findUpMultipleSync ( ( ) => 'unicorn.png' , { allowSymlinks : false } ) ) ;
149
171
expectType < string [ ] > ( findUpMultipleSync ( ( ) => 'unicorn.png' , { type : 'file' } ) ) ;
150
172
expectType < string [ ] > ( findUpMultipleSync ( ( ) => 'unicorn.png' , { type : 'directory' } ) ) ;
151
173
expectType < string [ ] > ( findUpMultipleSync ( ( ) => 'unicorn.png' , { stopAt : 'foo' } ) ) ;
152
174
expectType < string [ ] > ( findUpMultipleSync ( ( ) => undefined ) ) ;
153
175
expectType < string [ ] > ( findUpMultipleSync ( ( ) => undefined , { cwd : '' } ) ) ;
176
+ expectType < string [ ] > ( findUpMultipleSync ( ( ) => undefined , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
154
177
expectType < string [ ] > ( findUpMultipleSync ( ( ) => undefined , { allowSymlinks : true } ) ) ;
155
178
expectType < string [ ] > ( findUpMultipleSync ( ( ) => undefined , { allowSymlinks : false } ) ) ;
156
179
expectType < string [ ] > ( findUpMultipleSync ( ( ) => undefined , { type : 'file' } ) ) ;
157
180
expectType < string [ ] > ( findUpMultipleSync ( ( ) => undefined , { type : 'directory' } ) ) ;
158
181
expectType < string [ ] > ( findUpMultipleSync ( ( ) => undefined , { stopAt : 'foo' } ) ) ;
159
182
expectType < string [ ] > ( findUpMultipleSync ( ( ) : typeof findUpStop => findUpStop ) ) ;
160
183
expectType < string [ ] > ( findUpMultipleSync ( ( ) : typeof findUpStop => findUpStop , { cwd : '' } ) ) ;
184
+ expectType < string [ ] > ( findUpMultipleSync ( ( ) : typeof findUpStop => findUpStop , { cwd : new URL ( 'file:///path/to/cwd/' ) } ) ) ;
161
185
expectType < string [ ] > ( findUpMultipleSync ( ( ) : typeof findUpStop => findUpStop , { type : 'file' } ) ) ;
162
186
expectType < string [ ] > ( findUpMultipleSync ( ( ) : typeof findUpStop => findUpStop , { type : 'directory' } ) ) ;
163
187
expectType < string [ ] > ( findUpMultipleSync ( ( ) : typeof findUpStop => findUpStop , { stopAt : 'foo' } ) ) ;
0 commit comments