choojs / hyperx

🏷 - tagged template string virtual dom builder
BSD 2-Clause "Simplified" License
1.01k stars 48 forks source link

ignore attribute if injected value is null or undefined #70

Closed JRJurman closed 5 years ago

JRJurman commented 6 years ago

Summary

Often when injecting the value for a property it may resolve as undefined or null. These more often than not can be treated as not being assigned, however the current implementation sets them to the string value "undefined" or "null".

This PR introduces a change to ignore arguments which would evaluate to null or undefined. Look at the updated tests to see the full scope of this change.

JRJurman commented 6 years ago

Looking over the PRs, it appears this is a different implementation of #57 Not sure which is better or why the previous PR has yet to be merged...

goto-bus-stop commented 5 years ago

cherry-picked your additional tests into #57, thanks! unfortunately the squash-merge removed your credit from the commit log, sorry about that :/ i did add you to the gh release notes instead.