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');
1616/**
1717 * Inlined version of the package "package-up" (ESM only).
1818 *
19- * @param {string } cwd The directory to start searching from.
19+ * @param {{cwd: string}} options The directory to start searching from.
2020 * @returns {string|undefined } The path to the nearest package.json file or undefined if not found.
2121 */
2222module . exports = function ( { cwd } ) {
2323 return findUpSync ( 'package.json' , { cwd, type : 'file' } ) ;
2424} ;
2525
26+ /**
27+ * @param {string|URL } urlOrPath
28+ * @returns {string }
29+ */
2630function toPath ( urlOrPath ) {
2731 return urlOrPath instanceof URL ? fileURLToPath ( urlOrPath ) : urlOrPath ;
2832}
@@ -32,7 +36,7 @@ function toPath(urlOrPath) {
3236 *
3337 * @param {string } name The name of the file to find
3438 * @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.
3640 * @returns {string|undefined } The path to the file found or undefined if not found.
3741 */
3842function findUpSync ( name , { cwd = process . cwd ( ) } = { } ) {
You can’t perform that action at this time.
0 commit comments