Skip to content

Instantly share code, notes, and snippets.

@RStankov
Forked from madrobby/gist:862250
Created March 10, 2011 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RStankov/865156 to your computer and use it in GitHub Desktop.
Save RStankov/865156 to your computer and use it in GitHub Desktop.
function t(s,d){
return s.replace(/{([^}]*)}/g, function(_, p){
return (typeof d[p])[0]=='f' ? d[p]() : d[p];
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment