From 651eee711e6d14d79114f029e3de39b3502c3ab5 Mon Sep 17 00:00:00 2001 From: Oliver Schrenk Date: Wed, 27 Jun 2012 17:45:21 +0300 Subject: [PATCH] Use native ECMAScript 5 #trim() on String instead of using RegEx version Tested on node 0.8 --- lib/helpers.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/helpers.js b/lib/helpers.js index 816bc52..1a8f412 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -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) { @@ -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, '(.*)') + '$'