The Wayback Machine - https://web.archive.org/web/20220321044400/https://github.com/sindresorhus/find-up/pull/54
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stopAt option #54

Merged
merged 6 commits into from Sep 26, 2021
Merged

Conversation

vast
Copy link
Contributor

@vast vast commented Sep 16, 2021

Fixes #49.

readme.md Outdated
Type: `string`\
Default: `path.parse(cwd).root`

The absolute path to the directory to stop the search before reaching root if there were no matches before the `stopAt` directory.
Copy link
Owner

@sindresorhus sindresorhus Sep 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it have to be an absolute path? I think you can just path.resolve(cwd, stopAt) the input path you get from the user.

@sindresorhus
Copy link
Owner

@sindresorhus sindresorhus commented Sep 16, 2021

Thanks for working on this. You need to add types to index.d.ts too.

@vast
Copy link
Contributor Author

@vast vast commented Sep 16, 2021

Thanks for the feedback. Fixed both issues in:

Could you please have a look?

@vast vast requested a review from sindresorhus Sep 17, 2021
index.d.ts Outdated
@@ -8,6 +8,8 @@ export const findUpStop: unique symbol;

export type Match = string | typeof findUpStop | undefined;

export type Options = LocatePathOptions & {stopAt?: string};
Copy link
Owner

@sindresorhus sindresorhus Sep 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@vast vast Sep 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added docs:
c2134ed

test.js Show resolved Hide resolved
@vast vast requested a review from sindresorhus Sep 20, 2021
@sindresorhus sindresorhus changed the title Introduce stopAt option Add stopAt option Sep 26, 2021
@sindresorhus sindresorhus merged commit b3b3b00 into sindresorhus:main Sep 26, 2021
3 checks passed
@vast vast deleted the introduce-stop-at-option branch Sep 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants