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

Accept non-strings #13

Open
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@bfred-it
Copy link
Contributor

commented May 3, 2019

Real life example:

const fields = {}; // Object comes from contact form
htmlEscapeTag`Phone: ${fields.phone}`;

I would say:

  • strings and numbers: String(value)
  • everything else: ''
@sindresorhus

This comment has been minimized.

Copy link
Owner

commented May 6, 2019

everything else: ''

I think this would be very surprising behavior. Why not just String(value) everything like the normal interpolation?

bfred-it added some commits May 6, 2019

@bfred-it bfred-it changed the title Add failing tests for non-strings Accept non-strings May 6, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.