Skip to content

Add type and allowSymlinks options, only find files by default#4

Merged
sindresorhus merged 7 commits intosindresorhus:masterfrom
coreyfarrell:check-type
May 4, 2019
Merged

Add type and allowSymlinks options, only find files by default#4
sindresorhus merged 7 commits intosindresorhus:masterfrom
coreyfarrell:check-type

Conversation

@coreyfarrell
Copy link
Copy Markdown
Contributor

This is not ready to merge, just seeking early feedback. The
conditional code for stat vs lstat is a bit much, can/should this
logic be shifted to path-type or another module?

@coreyfarrell coreyfarrell changed the title WIP: Add support for type and followSymlinks options. Add support for type and followSymlinks options Apr 28, 2019
@coreyfarrell
Copy link
Copy Markdown
Contributor Author

@sindresorhus I've addressed your comments and modified readme.md, typescript definitions/tests. I really don't know typescript so hopefully I got that right.

One final question I have: is followSymlinks the best name for this option? The implementation uses this to control using fs.stat or fs.lstat, but does not cause the fs.realpath to be returned. I think this is best for locate-path and find-up, returning fs.realpath would be an edge case breaking change. Thinking about longer running processes that might use find-up to determine a path at startup then reopen at a later time. If the symbolic link were pointed to a new destination I think they would want to get that updated destination.

@sindresorhus sindresorhus changed the title Add support for type and followSymlinks options Add type and allowSymlinks options, only find files by default May 4, 2019
@sindresorhus sindresorhus merged commit 66c3567 into sindresorhus:master May 4, 2019
@coreyfarrell coreyfarrell deleted the check-type branch May 4, 2019 13:36
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.

2 participants