Skip to content

chore: inline file traversal function - #1079

Open
hyperz111 wants to merge 2 commits into
babel:mainfrom
hyperz111:inline-file-traversal
Open

chore: inline file traversal function#1079
hyperz111 wants to merge 2 commits into
babel:mainfrom
hyperz111:inline-file-traversal

Conversation

@hyperz111

@hyperz111 hyperz111 commented Jul 21, 2026

Copy link
Copy Markdown

Please Read the CONTRIBUTING Guidelines
In particular the portion on Commit Message Formatting

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Docs update
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

N/A

What is the new behavior?

N/A

Does this PR introduce a breaking change?

  • Yes
  • No

Other information:

We currently switch from find-up to empathic (using empathic/find entry), we use these for find the package root directory. But find-up and empathic/find has a major (i think) different:

  • find-up (in locate-path dependency) is using lstatSync, which is slower but safer. Because we can ensure if the entry is file or not.
  • empathic is using existsSync, which is faster but unsafe and can show a new bug. Because existsSync just check if the entry is available, no matter if the entry is a file or directory.

So if we want a safer but don't want to back to find-up, i prefer to inline the function instead. This will reduce the abstraction too i think.

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.

1 participant