Perhaps https://github.com/janl/mustache.js/blob/master/mustache.js#L52 ?