Skip to content

Instantly share code, notes, and snippets.

@didxga
Forked from madrobby/gist:862250
Created March 9, 2011 17:09
Show Gist options
  • Save didxga/862565 to your computer and use it in GitHub Desktop.
Save didxga/862565 to your computer and use it in GitHub Desktop.
function t(s,d){
for(var p in d)
s=s.replace(new RegExp('{'+p+'}','g'),typeof d[p][1]=='f'?d[p]():d[p]);
return s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment