Here you can find the source of interpolate(o)
String.prototype.interpolate = function (o) { if(o != undefined){ return this.replace(/*/{([^{}]*)}/g,*/ /{{([^{{}}]*)}}/g, function (a, b) { var r = o[b]; return typeof r === 'string' || typeof r === 'number' ? r : a; }/* w w w. jav a 2s . c o m*/ ); } return this.toString(); };
String.prototype.interpolate = function interpolate(vars) return this.replace(/\$([0-9a-z-A-Z_]+)/g, function (m, id) return (typeof vars[id] === "undefined") ? m : vars[id] ) ...
String.prototype.interpolate = function (o) { return this.replace(/{([^{}]*)}/g, function (a, b) { var r = o[b]; return typeof r === 'string' || typeof r === 'number' ? r : a; ); }; exports.String = String; ...
String.prototype.interpolate = function (o) { return this.replace(/%\{([^\{\}]*)\}/g, function (a, b) { var r = o[b]; return typeof r === 'string' || typeof r === 'number' ? r : a; ); };
String.prototype.interpolate = function (o) { return this.replace(/{([^{}]*)}/g, function (a, b) { var r = o[b]; return typeof r === 'string' || typeof r === 'number' ? r : a; ); };
String.prototype.interpolate = function(props) { return this.replace(/\{\{(\w+)\}\}/g, function(match, expr) { return (props || window)[expr]; }); };
String.prototype.interpolate = function(props) { return this.replace(/\{(\w+)\}/g, function(match, expr) { return (props || window)[expr]; }); };