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

fix: support directories named __proto__ #945

Merged
merged 3 commits into from Sep 15, 2023

Conversation

SukkaW
Copy link
Contributor

@SukkaW SukkaW commented Aug 19, 2023

The PR closes #938.

Link is currently using a plain object (Record<string, Link>) to hold the children information. The PR repalces the plain object with Map.

@SukkaW

This comment was marked as spam.

@SukkaW

This comment was marked as spam.

Comment on lines 63 to 70
let isDirectory = false;
try {
isDirectory = vol.statSync('/__proto__').isDirectory();
} catch {
// ignore
}

expect(isDirectory).toBe(true);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be better to just let the error throw, since if this test fails because of that the first thing you're going to want to do is see that error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was copying the test spec from existing test cases. But yes, throwing the error does make sense.

Copy link
Contributor Author

@SukkaW SukkaW Sep 13, 2023

Choose a reason for hiding this comment

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

Done in 2394a8e (#945).

@G-Rath G-Rath changed the title fix(#938): replace children plain object with Map fix: support directories named __proto__ Sep 15, 2023
@G-Rath G-Rath merged commit 8d92a0b into streamich:master Sep 15, 2023
10 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 15, 2023
## [4.2.2](v4.2.1...v4.2.2) (2023-09-15)

### Bug Fixes

* support directories named `__proto__` ([#945](#945)) ([8d92a0b](8d92a0b)), closes [#938](#938)
@streamich
Copy link
Owner

🎉 This PR is included in version 4.2.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors working with certain path names
3 participants