File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 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');
1616/**
1717 * Inlined version of the package "package-up" (ESM only).
1818 *
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.
2021 * @returns {string|undefined } The path to the nearest package.json file or undefined if not found.
2122 */
2223module . exports = function ( { cwd } ) {
2324 return findUpSync ( 'package.json' , { cwd, type : 'file' } ) ;
2425} ;
2526
27+ /**
28+ * @param {string|URL } urlOrPath
29+ * @returns {string }
30+ */
2631function toPath ( urlOrPath ) {
2732 return urlOrPath instanceof URL ? fileURLToPath ( urlOrPath ) : urlOrPath ;
2833}
@@ -32,7 +37,7 @@ function toPath(urlOrPath) {
3237 *
3338 * @param {string } name The name of the file to find
3439 * @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.
3641 * @returns {string|undefined } The path to the file found or undefined if not found.
3742 */
3843function findUpSync ( name , { cwd = process . cwd ( ) } = { } ) {
You can’t perform that action at this time.
0 commit comments