-
Notifications
You must be signed in to change notification settings - Fork 39
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: properly parse non-url encoded file specs #200
Conversation
There still appears to be some incorrect behavior here, that was here even before this PR. > require('.')('/path/br[acket')
Result {
type: 'directory',
registry: undefined,
where: '/Users/wraithgar/Development/npm/npm-package-arg/branches/gar_path-url-encoding',
raw: '/path/br[acket',
rawSpec: '/path/br[acket',
saveSpec: 'file:/path/br[acket',
fetchSpec: '/path/br[acket',
gitRange: undefined,
gitCommittish: undefined,
gitSubdir: undefined,
hosted: undefined
}
> decodeURI('file:/path/br[acket')
'file:/path/br[acket' but some new characters that this now allows (like %) will:
I chose not to encode |
Still some |
3e28f1e
to
ce6c05b
Compare
Properly creates file package args that contain characters that need to be url encoded. There is also a refactor/cleanup in here - Removed the magic windows global for testing, fixing the tests to mock process.platform instead. - Moved inline regexes up to where the others are defined - Renamed a few variables to be more correct (i.e. isFilename to isFileType) - Refactored Result to be a proper Class instead of a function w/ prototypes Closes: #193
ce6c05b
to
3c876a6
Compare
🤖 I have created a release *beep* *boop* --- ## [12.0.2](v12.0.1...v12.0.2) (2025-02-05) ### Bug Fixes * [`14cb8a1`](14cb8a1) [#200](#200) properly parse non-url encoded file specs (#200) (@wraithgar) ### Chores * [`1343a54`](1343a54) [#199](#199) bump @npmcli/template-oss from 4.23.4 to 4.23.5 (#199) (@dependabot[bot], @npm-cli-bot) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Properly creates file package args that contain characters that need to be url encoded.
There is also a refactor/cleanup in here
Closes: #193