Comparing version 6.0.0 to 6.1.0
/* eslint-disable @typescript-eslint/unified-signatures */ | ||
import {Options} from 'locate-path'; | ||
import {Options as LocatePathOptions} from 'locate-path'; | ||
@@ -11,2 +11,11 @@ /** | ||
export interface Options extends LocatePathOptions { | ||
/** | ||
The path to the directory to stop the search before reaching root if there were no matches before the `stopAt` directory. | ||
@default path.parse(cwd).root | ||
*/ | ||
readonly stopAt?: string; | ||
} | ||
/** | ||
@@ -141,3 +150,1 @@ Find a file or directory by walking up parent directories. | ||
export function pathExistsSync(path: string): boolean; | ||
export {Options} from 'locate-path'; |
@@ -9,2 +9,3 @@ import path from 'node:path'; | ||
const {root} = path.parse(directory); | ||
const stopAt = path.resolve(directory, options.stopAt || root); | ||
const paths = [name].flat(); | ||
@@ -38,3 +39,3 @@ | ||
if (directory === root) { | ||
if (directory === stopAt) { | ||
return; | ||
@@ -50,2 +51,3 @@ } | ||
const {root} = path.parse(directory); | ||
const stopAt = options.stopAt || root; | ||
const paths = [name].flat(); | ||
@@ -78,3 +80,3 @@ | ||
if (directory === root) { | ||
if (directory === stopAt) { | ||
return; | ||
@@ -81,0 +83,0 @@ } |
{ | ||
"name": "find-up", | ||
"version": "6.0.0", | ||
"version": "6.1.0", | ||
"description": "Find a file or directory by walking up parent directories", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -103,2 +103,9 @@ # find-up | ||
##### stopAt | ||
Type: `string`\ | ||
Default: `path.parse(cwd).root` | ||
The path to the directory to stop the search before reaching root if there were no matches before the `stopAt` directory. | ||
### pathExists(path) | ||
@@ -105,0 +112,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12302
184
155