Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
Merge pull request #158 from vladikoff/style-clean-up
Browse files Browse the repository at this point in the history
Style consistency cleanup
  • Loading branch information
dannycoates committed Aug 22, 2013
2 parents 3e2afdf + 6cd9341 commit 6f790a5
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
18 changes: 9 additions & 9 deletions client/api.js
@@ -1,5 +1,5 @@
var EventEmitter = require('events').EventEmitter;
var util = require('util');
var EventEmitter = require('events').EventEmitter
var util = require('util')

var hawk = require('hawk')
var P = require('p-promise')
Expand All @@ -8,9 +8,9 @@ var request = require('request')
var models = require('../models')({}, {}, {})
var tokens = models.tokens

util.inherits(ClientApi, EventEmitter);
util.inherits(ClientApi, EventEmitter)
function ClientApi(origin) {
EventEmitter.call(this);
EventEmitter.call(this)
this.origin = origin
}

Expand All @@ -36,17 +36,17 @@ ClientApi.prototype.doRequest = function (method, url, token, payload) {
method: method,
headers: headers,
json: payload || true
};
this.emit('startRequest', options);
}
this.emit('startRequest', options)
request(options, function (err, res, body) {
this.emit('endRequest', options, err, res);
this.emit('endRequest', options, err, res)
if (err || body.error) {
d.reject(err || body)
}
else {
d.resolve(body)
}
}.bind(this));
}.bind(this))
return d.promise
}

Expand Down Expand Up @@ -315,7 +315,7 @@ ClientApi.prototype.sessionDestroy = function (sessionTokenHex) {
}

ClientApi.heartbeat = function (origin) {
return (new ClientApi(origin)).doRequest('GET', origin + '/__heartbeat__');
return (new ClientApi(origin)).doRequest('GET', origin + '/__heartbeat__')
}

module.exports = ClientApi
4 changes: 2 additions & 2 deletions client/keystretch.js
Expand Up @@ -56,8 +56,8 @@ function derive(email, password, saltHex) {
.then(
function (stretchedPw) {
var input = new Buffer (stretchedPw, 'hex')
// if there's existingSalt use it
var lengthHkdf = 2 * 32;
var lengthHkdf = 2 * 32

return hkdf(input, 'mainKDF', salt, lengthHkdf)
}
)
Expand Down
4 changes: 2 additions & 2 deletions client/scrypt.js
Expand Up @@ -15,7 +15,7 @@ var scrypt = require('node-scrypt-js')
* @returns {Object} d.promise Deferred promise
*/
function hash(input, salt, url) {
var p;
var p
var payload = {
salt: salt,
N: 64 * 1024,
Expand All @@ -41,7 +41,7 @@ function hash(input, salt, url) {
function localScrypt(payload) {
var inputBinary = new Buffer(payload.input, "hex").toString("binary")
var spass = scrypt.scrypt(inputBinary, payload.salt, payload.N, payload.r, payload.p, payload.buflen)
var result = new Buffer(spass, 'base64').toString('hex');
var result = new Buffer(spass, 'base64').toString('hex')

return P(result)
}
Expand Down
2 changes: 1 addition & 1 deletion log.js
Expand Up @@ -21,7 +21,7 @@ module.exports = function (config) {
]

if (config.env !== 'production') {
logStreams.push({ stream: process.stdout, level: 'trace' });
logStreams.push({ stream: process.stdout, level: 'trace' })
}

var log = bunyan.createLogger(
Expand Down
2 changes: 1 addition & 1 deletion mailer.js
Expand Up @@ -4,7 +4,7 @@ var nodemailer = require('nodemailer')
var P = require('p-promise')
var handlebars = require("handlebars")

var TEMPLATE_PATH = path.join(__dirname, "templates", "email");
var TEMPLATE_PATH = path.join(__dirname, "templates", "email")

function loadTemplate (name) {
return fs.readFileSync(path.join(TEMPLATE_PATH, name))
Expand Down
2 changes: 1 addition & 1 deletion routes/defaults.js
Expand Up @@ -31,7 +31,7 @@ module.exports = function (P, kv) {
}
}
}
];
]

return routes
}
14 changes: 7 additions & 7 deletions stats/heka.js
Expand Up @@ -17,7 +17,7 @@ module.exports = function (Heka) {
severity: 5
}
)
);
)
}

HekaStats.prototype.mem = function (usage) {
Expand All @@ -34,8 +34,8 @@ module.exports = function (Heka) {
pid: this.pid,
hostname: this.hostname
}
);
};
)
}

HekaStats.prototype.request = function (event) {
this.client.heka(
Expand All @@ -51,8 +51,8 @@ module.exports = function (Heka) {
pid: this.pid,
hostname: this.hostname
}
);
};
)
}

return HekaStats;
};
return HekaStats
}
4 changes: 2 additions & 2 deletions test/run/hkdf_tests.js
Expand Up @@ -9,7 +9,7 @@ test(
stretchedPw = new Buffer (stretchedPw,'hex')
var info = 'mainKDF'
var salt = new Buffer ('00f000000000000000000000000000000000000000000000000000000000034d','hex')
var lengthHkdf = 2 * 32;
var lengthHkdf = 2 * 32

function end() { t.end() }

Expand Down Expand Up @@ -38,7 +38,7 @@ test(
stretchedPw = new Buffer (stretchedPw, 'hex')
var info = 'mainKDF'
var salt = new Buffer ('00f000000000000000000000000000000000000000000000000000000000034d', 'hex')
var lengthHkdf = 2 * 32;
var lengthHkdf = 2 * 32

function end() { t.end() }

Expand Down
4 changes: 2 additions & 2 deletions test/run/integration_tests.js
Expand Up @@ -18,7 +18,7 @@ function main() {
"algorithm":"RS",
"n":"4759385967235610503571494339196749614544606692567785790953934768202714280652973091341316862993582789079872007974809511698859885077002492642203267408776123",
"e":"65537"
};
}
var duration = 1000 * 60 * 60 * 24
Client.create(config.public_url, email, password)
.then(
Expand Down Expand Up @@ -116,7 +116,7 @@ function main() {
"algorithm":"RS",
"n":"4759385967235610503571494339196749614544606692567785790953934768202714280652973091341316862993582789079872007974809511698859885077002492642203267408776123",
"e":"65537"
};
}
var duration = 1000 * 60 * 60 * 24
Client.login(config.public_url, email, password)
.then(
Expand Down

0 comments on commit 6f790a5

Please sign in to comment.