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

string-template can't return number 0 #576

Open
lizyChy0329 opened this issue Jan 31, 2024 · 0 comments
Open

string-template can't return number 0 #576

lizyChy0329 opened this issue Jan 31, 2024 · 0 comments

Comments

@lizyChy0329
Copy link

lizyChy0329 commented Jan 31, 2024

If value is 0, return ''. How about fix it to return String(value) || ''

return value || '';

And I find that: keyParts[i] will return ' setting' when templete is {{ setting.count }}, so lead to value[keyParts[i]] is undefined

@lizyChy0329 lizyChy0329 changed the title string-template do not return number type value string-template can't return number 0 Jan 31, 2024
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

No branches or pull requests

1 participant