Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.

Update slack.ts#605

Merged
GuruPKK merged 5 commits intomasterfrom
FIX_URL_SLUG_DEFAULT_LOGIC
Mar 15, 2022
Merged

Update slack.ts#605
GuruPKK merged 5 commits intomasterfrom
FIX_URL_SLUG_DEFAULT_LOGIC

Conversation

@GuruPKK
Copy link
Copy Markdown
Contributor

@GuruPKK GuruPKK commented Mar 15, 2022

No description provided.

const isStableBranch = branchObject.aliasObject.isStableBranch; // bool or Falsey
aliases = aliases?.filter((a) => a);
if (!urlSlug && non_versioned == false) {
if (!urlSlug || urlSlug === '') {
Copy link
Copy Markdown
Contributor

@casthewiz casthewiz Mar 15, 2022

Choose a reason for hiding this comment

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

I don't think urlSlug === '' will ever evaluate - '' will be falsey here, so it should get caught by !urlSlug

it might be worth running a .trim() on urlSlug in case it's just whitespace here, and then explicitly asserting truthiness? Something like if (!urlSlug || !!urlSlug.trim())?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done, updated it

Copy link
Copy Markdown
Contributor

@casthewiz casthewiz left a comment

Choose a reason for hiding this comment

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

I think this is good from what I know about version handling and slug behavior - added a suggestion to catch a potential edge case

@GuruPKK GuruPKK merged commit 5dd44fc into master Mar 15, 2022
@schmalliso schmalliso deleted the FIX_URL_SLUG_DEFAULT_LOGIC branch November 9, 2022 15:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants