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