File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,18 @@ const { fileURLToPath } = require('url');
16
16
/**
17
17
* Inlined version of the package "package-up" (ESM only).
18
18
*
19
- * @param {string } cwd The directory to start searching from.
19
+ * @param {object } options
20
+ * @param {string } options.cwd The directory to start searching from.
20
21
* @returns {string|undefined } The path to the nearest package.json file or undefined if not found.
21
22
*/
22
23
module . exports = function ( { cwd } ) {
23
24
return findUpSync ( 'package.json' , { cwd, type : 'file' } ) ;
24
25
} ;
25
26
27
+ /**
28
+ * @param {string|URL } urlOrPath
29
+ * @returns {string }
30
+ */
26
31
function toPath ( urlOrPath ) {
27
32
return urlOrPath instanceof URL ? fileURLToPath ( urlOrPath ) : urlOrPath ;
28
33
}
@@ -32,7 +37,7 @@ function toPath(urlOrPath) {
32
37
*
33
38
* @param {string } name The name of the file to find
34
39
* @param {object } options
35
- * @param {string } options.cwd The directory to start searching from.
40
+ * @param {string= } options.cwd The directory to start searching from.
36
41
* @returns {string|undefined } The path to the file found or undefined if not found.
37
42
*/
38
43
function findUpSync ( name , { cwd = process . cwd ( ) } = { } ) {
You can’t perform that action at this time.
0 commit comments