Files
opentf/website/source/assets/javascripts/lib/_String.substitute.js
Seth Vargo 85d54e62d3 Do not build supporting JS files
These files are already included in the bundle
2016-03-22 23:33:40 +02:00

15 lines
336 B
JavaScript

(function(String){
if (String.prototype.substitute) {
return;
}
String.prototype.substitute = function(object, regexp){
return String(this).replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){
if (match.charAt(0) == '\\') return match.slice(1);
return (object[name] !== null) ? object[name] : '';
});
};
})(String);