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

Added method to get an iterator for all files in HasteFS #7010

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added method to get an iterator for all files in HasteFS
  • Loading branch information
rubennorte committed Sep 20, 2018
commit a05fdbc986e8d44eddcc6d30b9b0ed528da3248c
4 changes: 4 additions & 0 deletions packages/jest-haste-map/src/haste_fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export default class HasteFS {
return Array.from(this._files.keys());
}

getFileIterator(): Iterator<string> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rafeca you'll be able to use this in Metro. It should be way faster if you just want to iterate over the files.

return this._files.keys();
}

matchFiles(pattern: RegExp | string): Array<Path> {
if (!(pattern instanceof RegExp)) {
pattern = new RegExp(pattern);
Expand Down