Skip to content

Commit

Permalink
strips all whitespace from tokens before processing
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbrokke committed Feb 13, 2016
1 parent a0e9232 commit b582668
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ TokenReplacer.prototype = {
},

getMethodName: function(token) {
return this.trimOuterWhitespace(this.getArray(token)[0]);
return this.getArray(token)[0];
},

processString: function(s) {
Expand All @@ -64,6 +64,8 @@ TokenReplacer.prototype = {
},

replaceToken: function(token) {
token = this.stripWhitespace(token);

var methodName = this.getMethodName(token);
var configurationObject = this.getConfigurationObject(token);

Expand Down Expand Up @@ -115,12 +117,12 @@ TokenReplacer.prototype = {
return s;
},

trimLeftBang: function(s) {
return _.trimStart(s, '!');
stripWhitespace: function(s) {
return s.replace(/ /g, '');
},

trimOuterWhitespace: function(s) {
return _.trim(s, ' ');
trimLeftBang: function(s) {
return _.trimStart(s, '!');
},

PATTERN_BACKREFERENCE: /!\d/gi,
Expand Down

0 comments on commit b582668

Please sign in to comment.