-
Notifications
You must be signed in to change notification settings - Fork 34
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 windows directory detect #106
Conversation
fix window file separator
WalkthroughThe update focuses on enhancing directory detection in the Changes
Possibly related issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Sweep: PR ReviewAuthors of pull request: @grj001 lib/zip/uncompress_stream.jsEnhanced directory name detection to support both forward and backslashes as terminators. Sweep Found These Issues
compressing/lib/zip/uncompress_stream.js Lines 101 to 103 in 64482e0
View Diff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- lib/zip/uncompress_stream.js (1 hunks)
Additional comments not posted (1)
lib/zip/uncompress_stream.js (1)
102-102
: Updated regex to handle both backslashes and forward slashes is appropriate for cross-platform compatibility.Verification successful
The
rg
search found multiple usages ofentry.fileName
inlib/zip/uncompress_stream.js
. Here are the relevant lines:
lib/zip/uncompress_stream.js: if (Buffer.isBuffer(entry.fileName)) {
lib/zip/uncompress_stream.js: entry.fileName = entry.fileName.toString();
lib/zip/uncompress_stream.js: entry.fileName = iconv.decode(entry.fileName, this._zipFileNameEncoding);
lib/zip/uncompress_stream.js: const type = /[\\\/]$/.test(entry.fileName) ? 'directory' : 'file';
lib/zip/uncompress_stream.js: const name = entry.fileName = this[STRIP_NAME](entry.fileName, type);
The regex change appears in the context of determining the type of the entry (directory or file). The other usages involve converting
entry.fileName
to a string and decoding it, which should not be affected by the regex change.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the updated regex does not affect other parts of the system. # Test: Search for other usages of `entry.fileName` that might be affected by the regex change. rg --type javascript $'entry.fileName'Length of output: 72
Script:
#!/bin/bash # Description: Verify that the updated regex does not affect other parts of the system. # Test: Search for other usages of `entry.fileName` that might be affected by the regex change. rg --type js 'entry.fileName'Length of output: 517
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- lib/zip/uncompress_stream.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- lib/zip/uncompress_stream.js
[skip ci] ## [1.10.1](v1.10.0...v1.10.1) (2024-05-23) ### Bug Fixes * support windows directory detect ([#106](#106)) ([122091b](122091b))
fix window file separator
Summary by CodeRabbit