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 Object.assign warning for safer code runtime #151

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jwmann
Copy link
Contributor

@jwmann jwmann commented Feb 3, 2020

No description provided.

@DanielRuf
Copy link
Contributor

Hi, which warning does this fix?

@jwmann
Copy link
Contributor Author

jwmann commented Feb 3, 2020

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
Contributor

Shouldn't it be normally {}?

@jwmann
Copy link
Contributor Author

jwmann commented Feb 3, 2020

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.

None yet

2 participants