UNPKG

335 BJavaScriptView Raw
1
2var 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};
18module.exports = tools;
\No newline at end of file