| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 85.00000% with 9 lines in your changes missing coverage. Please review.
@@ Coverage Diff @@
## main #54367 +/- ##
==========================================
+ Coverage 87.09% 88.23% +1.14%
==========================================
Files 648 651 +3
Lines 182216 183895 +1679
Branches 34965 35847 +882
==========================================
+ Hits 158704 162267 +3563
+ Misses 16785 14913 -1872
+ Partials 6727 6715 -12
... and 248 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
| @@ -687,6 +707,19 @@ const win32 = { | |||
| if (typeof path !== 'string' || path.length === 0) | |||
| return path; | |||
|
|
|||
| // Check if the path matches any device pattern | |||
| if (ObjectValues(windowDevicePatterns).some((pattern) => pattern.test(path))) { | |||
There was a problem hiding this comment.
Would it be faster if the object was an array?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, you're correct. My local benchmarks confirm that using an array is indeed faster than using an object. Thank you very much for your thorough review. I will take this and apply the changes accordingly
Sorry, something went wrong.
| @@ -180,6 +180,25 @@ function glob(path, pattern, windows) { | |||
| }); | |||
| } | |||
|
|
|||
| // Regular expressions to identify special device names in Windows. | |||
| // Ref: https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea | |||
| // COM to AUX (e.g., COM1, LPT1, NUL, CON, PRN, AUX) are reserved OS device names. | |||
There was a problem hiding this comment.
| // COM to AUX (e.g., COM1, LPT1, NUL, CON, PRN, AUX) are reserved OS device names. | |
| // | |
| // COM to AUX (e.g., COM1, LPT1, NUL, CON, PRN, AUX) are reserved OS device names. |
This might help to separate the ideas
Sorry, something went wrong.
There was a problem hiding this comment.
You're absolutely right. Moreover, the code I recently added is currently checking all regular expressions in the device namespace, which has significantly reduced performance. As you suggested, I will try to improve performance by distinguishing between special devices and reserved devices during the inspection. Thank you.
Sorry, something went wrong.
There was a problem hiding this comment.
I added comments to differentiate between reserved and non-reserved device names, explaining the differences between regular expressions like /([\\/])?(COM\d+)$/i and /^(PHYSICALDRIVE\d+)$/i. While I tried to maintain performance while addressing the issues, I couldn't find a way to do so effectively because reserved device names can also appear in paths (e.g., C:/path/COM1). If anyone has a better solution that maintains performance while resolving this, I welcome suggestions.
Sorry, something went wrong.
|
I believe this is already being fixed in #54224 |
Sorry, something went wrong.
|
Thank you for let me know sir. I'll close this PR |
Sorry, something went wrong.
|
sir Im bit confused that #54224 seems to be focused on fixing an issue where a trailing backslash was incorrectly added in the resolve function, whereas my PR is specifically aimed at converting file paths to namespace paths in the tonamespaced function. It seems these are addressing different concerns..? |
Sorry, something went wrong.
|
I would work on this issue after finishing my current work. So, I reviewed this PR. This PR fixes a different problem than #54224 and LGTM. I think the author can continue working on this by reopening it. |
Sorry, something went wrong.
|
I believe this PR could fix #54161 as well. The conout$ and conin$ could be added as regular expressions. What do you think? |
Sorry, something went wrong.
|
Thank you for your valuable feedback. I initially included only CON as a regular expression, but I completely agree that conout$ and conin$ should also be added as regular expressions. I will reopen this PR tomorrow. I appreciate your guidance. |
Sorry, something went wrong.
|
Note that toNamespacedPath also has a C++ implementation that would have to be updated as well. |
Sorry, something went wrong.
|
Thank you for let me know. I just updated C++ implementation as well. |
Sorry, something went wrong.
|
@targos I made the changes based on your feedback. Could you review this PR when you have a moment? |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
Of course. Thank you for let me know. I updated the doc also according to your feedback. |
Sorry, something went wrong.
|
Hi, is the original issue still relevant? I was in the process of backporting #52135 which seems to have caused some regressions and it seems this is fixing one of the them that are still around? |
Sorry, something went wrong.
|
The original issue (the lack of support for the device namespace in toNamespace on Windows) still seems unresolved. However, if #52135 modified the C++ implementation of toNamespace, it seems likely that the C++ portion of this PR would also need adjustments. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Updated the win32 toNamespacedPath function to support device namespace paths as per #54180 and #54161.
url.pathToFileURL was not modified since device namespace paths are not valid file URIs.