Skip to content

Commit

Permalink
Added extends.js which is where we can extend some of the Javascript …
Browse files Browse the repository at this point in the history
…classes, in this example String has had a method for injecting values
  • Loading branch information
jimib committed Oct 14, 2012
1 parent fe11082 commit 7b15ca4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/preinit/extends.js
@@ -0,0 +1,6 @@
module.exports = function(app){
String.prototype.injectParam = function(param, value){
var regexp = new RegExp(":"+param, "g");
return this.toString().replace(regexp, value);
}
}

0 comments on commit 7b15ca4

Please sign in to comment.