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: don't treat vX.X.X folders as files #63

Merged
merged 1 commit into from
Nov 12, 2023
Merged

Conversation

flakey5
Copy link
Member

@flakey5 flakey5 commented Nov 11, 2023

@flakey5 flakey5 requested a review from a team as a code owner November 11, 2023 23:32
Copy link
Member

@ovflowd ovflowd left a comment

Choose a reason for hiding this comment

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

LGTM

const fileExtension = path.substring(extensionDelimiter + 1); // +1 to remove the `.`

// `latest-vXX.x` directory
if (fileExtension.toLowerCase() === 'x') {
Copy link
Member

Choose a reason for hiding this comment

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

What if we check if it is a number or a string with more than two digits? I do not know of any valid file extension of just one digit, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it should support any number of characters just because there are folders such as https://nodejs.org/download/release/v0.1.100/

Copy link
Member

Choose a reason for hiding this comment

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

No what I meant is the following:

  • Instead of checking against the file extension being "X" you check if it is one alphanumeric character or N digits number. Like it can be a number of any length but a string/character of 1 length.

It would even make sense to test with regex.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh I see, yeah I think that'd be a better way of doing this

@flakey5 flakey5 merged commit b854489 into main Nov 12, 2023
3 checks passed
@ovflowd ovflowd deleted the flakey5/nodejs.org/6110 branch November 12, 2023 10:53
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.

Broken links to release downloads on Previous Releases page (missing trailing '/')
2 participants