1 |
|
2 | var tools = {
|
3 | trim: function(str){
|
4 | str = str.replace(/^\s+/, '');
|
5 | for (var i = str.length - 1; i >= 0; i--) {
|
6 | if (/\S/.test(str.charAt(i))) {
|
7 | str = str.substring(0, i + 1);
|
8 | break;
|
9 | }
|
10 | }
|
11 | return str;
|
12 | },
|
13 |
|
14 | getDirSeparator: function(){
|
15 | return process.platform == 'win32' ? '\\' : '/';
|
16 | }
|
17 | };
|
18 | module.exports = tools; |
\ | No newline at end of file |