Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Fix for turnaries always being truthy when passed to escaping EJS tags. #13
The implementation was prepending an empty string blindly to the front of the fragment provided to the tags which caused the turnary to always be evaluated truthily.
<%- this.ad.activity ? this.ad.activity.activity : "" %>
(''+this.ad.activity ? this.ad.activity.activity : "")
... which is always truthy because of the type coercion. It now produces:
(''+(this.ad.activity ? this.ad.activity.activity : ""))
... which properly honors the intention of the evaluation.