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 support for path matcher function #28
Merged
Merged
Changes from 14 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
95d4390
Add support for filename matcher function
sholladay 8b80cf1
Improve documentation
sholladay e8072bb
Seperate not found tests
sholladay 44e67bf
Bubble up errors correctly
sholladay 102b688
Fix indentation
sholladay 7a83413
Merge branch 'master' of github.com:sindresorhus/find-up
sholladay 6ad0dd8
Fix lint errors
sholladay ca48c76
Add Symbol for stopping early
sholladay f858bdd
Merge branch 'master' of github.com:sindresorhus/find-up
sholladay eff8479
Use util.promisify instead of pify
sholladay cba6f26
Add documentation and TypeScript types
sholladay af9d361
Tweak documentation
sindresorhus b10d5b2
Simplify examples
sholladay eb97a2f
Merge branch 'master' of github.com:sholladay/find-up
sholladay ae4d8bc
Use unique symbol
sindresorhus bb10d62
Ensure symbol is readonly
sholladay 94fafd1
Add test for finding nested dir at path.basename(cwd) (#1)
coreyfarrell 41b8bdb
More strict TypeScript types
sholladay cf3157c
Update index.d.ts
sindresorhus File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discovered that there's seemingly no way for me to tell TypeScript that the only boolean type that should be allowed is
false
. Annoying. Should we support returningtrue
? It's easy to support, but I remember we discussed that the semantics may not be obvious.Also, should I put this type on the namespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should type this one as:
While JS is loose, we should try to keep the TS types strict.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree in general, but in this case, if we are very strict, then people can't necessarily do:
... since
foo
might befalse
ornull
, etc. Is it worth losing that nice syntax?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TS users will definitely say yes. That's why they're using TS; they want strict types. It doesn't affect the majority that is using plain JS.
TS users can do:
It's just a tiny bit more verbose.