Skip to content

Commit

Permalink
Use native ECMAScript 5 #trim() on String instead of using RegEx version
Browse files Browse the repository at this point in the history
Tested on node 0.8
  • Loading branch information
oschrenk committed Jun 27, 2012
1 parent e9b9040 commit 651eee7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/helpers.js
Expand Up @@ -39,11 +39,6 @@ exports.whenDirectoryExists = function(directory, callback) {
})
}

exports.trim = function(text) {

return text.replace(/^\s*/, '').replace(/\s*$/, '')
}

exports.traverseDir = function(dir, callback) {

fs.readdir(dir, function(err, children) {
Expand Down Expand Up @@ -368,7 +363,7 @@ exports.readIgnoreListFromFile = function(file) {
}

// trim blank space from start/end of line
line = helpers.trim(line)
line = line.trim();

// change file pattern to regex
line = '^' + line.replace(/\*/g, '(.*)') + '$'
Expand Down

0 comments on commit 651eee7

Please sign in to comment.