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
Strip null values from CloudFormation template resource properties #10304
Conversation
…resource properties
Codecov Report
@@ Coverage Diff @@
## master #10304 +/- ##
==========================================
+ Coverage 85.40% 85.42% +0.01%
==========================================
Files 339 339
Lines 13877 13910 +33
==========================================
+ Hits 11852 11882 +30
- Misses 2025 2028 +3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GurmeharS that looks great ! I've just propose one minor simplification, and it's good to go
Object.entries(obj).forEach(([propName, propVal]) => { | ||
if (propVal === null) { | ||
delete obj[propName]; | ||
} else if (propVal && typeof propVal === 'object') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can simplify to if (typeof === 'object')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Pushed out an update 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @GurmeharS !
Previously,
stripNullPropsFromTemplateResources
stripped null from top-level resource properties in the compiled CFN template.This PR:
Closes: #10279