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.
This PR is two-fold:
Use BigInts for ino IDs
As reported in #21, using Numbers for ino IDs is dangerous, because real ino IDs are 64-bit and can overflow the 32-bit Numbers, which can make the program believe that two different files are the same file, and then only count the size of one of them.
This change is theoretically just a minor fix, but if anyone uses a custom filesystem, it now has to support BigInts, which it did not have to do previously. Therefore, I think we should release this as v4.0.0 to avoid possible breakage.
Fixes #21
Support folder size output as BigInt
This change is arguably less important, and yet much more complex. It allows the user to choose that the size of the folder is returned as a BigInt. This is only necessary if you are working with crazy large folders, but there can be other practical reasons that you'd want the output as a BigInt.
It's a pretty common feature in other node libraries, and is also modeled to work the same way as other libraries, such as
fs
.