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(api,framework): Undefined variables parsing #8041

Merged
merged 1 commit into from
Apr 9, 2025
Merged

Conversation

desiprisg
Copy link
Contributor

What changed? Why was the change needed?

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

netlify bot commented Apr 1, 2025

Deploy Preview for dashboard-v2-novu-staging canceled.

Name Link
🔨 Latest commit 184e0e9
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/67ebfa84d213400008bc8fab

Copy link

pkg-pr-new bot commented Apr 1, 2025

Open in StackBlitz

npm i https://pkg.pr.new/novuhq/novu/@novu/framework@8041
npm i https://pkg.pr.new/novuhq/novu@8041

commit: 184e0e9

@@ -20,6 +20,6 @@ const stringifyDataStructureWithSingleQuotes = (value: unknown, spaces: number =

return valueEscapedNewLines;
} else {
return String(value);
return value == null ? '' : String(value as unknown);
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this shortcut, but because this is very sensitive part i wonder if we should go with the more explicit version "value === null || value === undefined" instead.
What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's different with that version ?

Copy link
Contributor

Choose a reason for hiding this comment

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

String(value) when value is undefined returns undefined. Isn't that the reason we started this PR in the first place?

@desiprisg desiprisg merged commit cf02d82 into next Apr 9, 2025
28 of 32 checks passed
@desiprisg desiprisg deleted the undefined_variables branch April 9, 2025 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants