Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

fix: yaml formatting #557

Merged
merged 1 commit into from
Jan 10, 2024
Merged

fix: yaml formatting #557

merged 1 commit into from
Jan 10, 2024

Conversation

r4zendev
Copy link
Contributor

Fixes edge-cases where yaml field can start with tilde and end with a non-word character

@r4zendev r4zendev self-assigned this Jan 10, 2024
@@ -429,7 +429,13 @@ export const convertToYaml = (
}
titleWithVersion = capitalize(titleWithVersion);

const shortDescription = description.split('\n').at(0);
const shortDescription = description
Copy link
Contributor

Choose a reason for hiding this comment

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

this can be undefined, can it be?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

technically it's not possible because split will always return a single-item array even if no splits happened
it's the native typing of at() method that causes optional chaining to be necessary. i would still prefer it over non-null assertion.

@grzpab grzpab merged commit 897011b into main Jan 10, 2024
5 checks passed
@grzpab grzpab deleted the yaml-format-bugfix branch January 10, 2024 12:23
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