Skip to content

Conversation

@lvcabral
Copy link

@lvcabral lvcabral commented Nov 4, 2025

Implemented both ISO and ZIP and added Unit Tests

Copy link
Member

@james-pre james-pre left a comment

Choose a reason for hiding this comment

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

Looking good, I've gotten started with some suggestions to improve the code style and such. Thanks for contributing!

lvcabral and others added 4 commits November 5, 2025 13:48
Co-authored-by: James Prevett <jp@jamespre.dev>
Co-authored-by: James Prevett <jp@jamespre.dev>
@james-pre
Copy link
Member

Also it would be nice to have a new test (or multiple new tests) to make this works correctly.

@lvcabral lvcabral marked this pull request as ready for review November 6, 2025 23:46
@lvcabral lvcabral requested a review from james-pre November 6, 2025 23:46
Copy link
Member

@james-pre james-pre left a comment

Choose a reason for hiding this comment

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

Looks good so far. I have some very minor feedback but I think it is almost ready to merge.

for (const part of path.split('/').slice(1)) {
if (!dir.isDirectory()) return;
dir = dir.directory.get(part);
const directory: Directory = dir.directory;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const directory: Directory = dir.directory;
const { directory } = dir;

Comment on lines +140 to 151
if (!next && this.options.caseFold) {
const foldedPart = this._caseFold(part);
for (const [name, record] of directory) {
if (this._caseFold(name) === foldedPart) {
next = record;
break;
}
}
}

dir = next;
if (!dir) return;
Copy link
Member

Choose a reason for hiding this comment

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

This is kind of difficult to read... if there is a way to make it more readable & reduce indentation that would be great— perhaps using a gaurd clause?

Comment on lines +157 to +163
private _caseFold(original: string): string {
if (!this.options.caseFold) {
return original;
}

return this.options.caseFold === 'upper' ? original.toUpperCase() : original.toLowerCase();
}
Copy link
Member

Choose a reason for hiding this comment

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

This is duplicated with ZipFS as well. To reduce duplcation, I'm thinking:

  • Make options public but add @internal
  • Change case fold to be @internal, and take the FS: _caseFold(fs: FileSystem, path: string) => string
  • Both FSes use the shared case fold function

@james-pre james-pre linked an issue Nov 7, 2025 that may be closed by this pull request
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.

Add support for the caseFold configuration

2 participants