tiny-mustache
tiny-mustache copied to clipboard
property access speed improvement
- removed recursion
- removed array shift
- addeed property caching
@sreekotay Thank you for the pull request. Even if this speed optimization is perfectly valid I am not going to merge it into the master, as the main goal of the project is to keep the code as small as possible.
I discovered the following bug when testing the code of @sreekotay that does not occur in the original: When empty strings are passed the variables are replaced with null. For example, mustache("Hello {{name}}!", {name: ""})
returns Hello null!
instead Hello !
.