diff options
| author | Misko Hevery | 2011-10-07 11:27:49 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-10-11 11:01:46 -0700 |
| commit | fd822bdaf9d04e522aaa5400b673f333190abe98 (patch) | |
| tree | 451cd26d3f7da862692d6c56e6e8f235824c180a /gdocs.js | |
| parent | 4f78fd692c0ec51241476e6be9a4df06cd62fdd6 (diff) | |
| download | angular.js-fd822bdaf9d04e522aaa5400b673f333190abe98.tar.bz2 | |
chore(formating): clean code to be function() {
Diffstat (limited to 'gdocs.js')
| -rwxr-xr-x | gdocs.js | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -36,7 +36,7 @@ if (flag == '--login') { help(); } -function help(){ +function help() { console.log('Synopsys'); console.log('gdocs.js --login <username>'); console.log('gdocs.js --fetch [<docs collection>]'); @@ -141,7 +141,7 @@ function login(username, password){ ); } -function getAuthToken(){ +function getAuthToken() { var pwdFile = 'tmp/gdocs.auth'; try { fs.statSync(pwdFile); @@ -164,10 +164,10 @@ function request(method, url, options, response) { case 200: var data = []; res.setEncoding('utf8'); - res.on('end', function (){ response(data.join('')); }); - res.on('close', function (){ response(data.join('')); }); // https + res.on('end', function () { response(data.join('')); }); + res.on('close', function () { response(data.join('')); }); // https res.on('data', function (chunk) { data.push(chunk); }); - res.on('error', function (e){ console.log(e); }); + res.on('error', function (e) { console.log(e); }); break; case 401: console.log('Eror: Login credentials expired! Please login.'); @@ -190,7 +190,7 @@ function request(method, url, options, response) { } if (options.data) request.write(encodeData(options.data)); - request.on('end', function(){ + request.on('end', function() { console.log('end'); }); request.end(); @@ -212,7 +212,7 @@ function askPassword(callback) { console.log('Enter your password:'); var password = ""; - stdin.on("data", function (c) { + stdin.on("data", function(c) { c = c + ""; switch (c) { case "\n": case "\r": case "\u0004": @@ -236,7 +236,7 @@ function reflow(text, margin) { text.split(/\n/).forEach(function(line) { var col = 0; var reflowLine = ''; - function flush(){ + function flush() { reflowLine = reflowLine.replace(/\s*$/, ''); lines.push(reflowLine); reflowLine = ''; |
