Skip to content

Fix Object.assign warning for safer code runtime#151

Open
jwmann wants to merge 2 commits into
RelaxedJS:masterfrom
jwmann:fix/object-assign-warning
Open

Fix Object.assign warning for safer code runtime#151
jwmann wants to merge 2 commits into
RelaxedJS:masterfrom
jwmann:fix/object-assign-warning

Conversation

@jwmann

@jwmann jwmann commented Feb 3, 2020

Copy link
Copy Markdown
Contributor

No description provided.

@DanielRuf

Copy link
Copy Markdown
Contributor

Hi, which warning does this fix?

@jwmann

jwmann commented Feb 3, 2020

Copy link
Copy Markdown
Contributor Author

Screen Shot on 2020-02-03 at 14-59-58

I know it's not a typescript project but it's good practise to use Object.assign with an empty literal, or a constant value first, especially if we're spreading a potentially undefined value.

@DanielRuf

Copy link
Copy Markdown
Contributor

Shouldn't it be normally {}?

@jwmann

jwmann commented Feb 3, 2020

Copy link
Copy Markdown
Contributor Author

You are very correct :)
Good catch

I made the incorrect assumption that pugFilters was an array. After checking, it's definitely not! 😅

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.

2 participants