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

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

@vast
Copy link
Contributor Author

vast commented Sep 16, 2021

Thanks for the feedback. Fixed both issues in:

Could you please have a look?

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

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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
@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
@vast vast deleted the introduce-stop-at-option branch September 26, 2021 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add stopAt option
2 participants