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: handle nulls/undefined in template literal #1370

Merged
merged 3 commits into from
Jul 19, 2024

Conversation

mshanemc
Copy link
Contributor

What does this PR do?

if it's logging/debug, insert some placeholder to indicate that it's not present
for values used in "real" code, preserve existing behavior. Many of these are from inadequate types on the metadataRegistry (ex: DEB or StaticResource have a suffix, etc)

What issues does this PR fix or reference?

@ W-16116290@

@mshanemc mshanemc requested a review from a team as a code owner July 19, 2024 16:44
@@ -147,7 +148,9 @@ export class DigitalExperienceSourceAdapter extends BundleSourceAdapter {
// 3 because we want 'digitalExperiences' directory, 'baseType' directory and 'bundleName' directory
const basePath = pathParts.slice(0, typeFolderIndex + 3).join(sep);
const bundleFileName = pathParts[typeFolderIndex + 2];
const suffix = this.isBundleType() ? this.type.suffix : this.registry.getParentType(this.type.id)?.suffix;
const suffix = ensureString(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this will throw, so ex: if the metadataRegistry ever loses a suffix for DEB stuff, it'll fail tests

@mdonnalley mdonnalley merged commit 2f8dac3 into main Jul 19, 2024
73 checks passed
@mdonnalley mdonnalley deleted the sm/template-literal-linter branch July 19, 2024 19:49
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.

3 participants