Skip to content

Commit 6eaab05

Browse files
Minor cleanup
* Add jshint rules * Remove dead requires & functions * Fix some semicolon errors
1 parent f7df2fd commit 6eaab05

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

.jshintrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"freeze": true,
3+
"latedef": "nofunc",
4+
"undef": true,
5+
"unused": true,
6+
"trailing": true,
7+
"immed": true,
8+
"predef": ["console", "require", "__dirname"],
9+
"esnext": true,
10+
"lastsemic": true
11+
}

index.js

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
/*global process, exports*/
2+
const Buffer = require('buffer').Buffer;
13
const Stream = require('stream');
24
const util = require('util');
35
const base64url = require('base64url');
4-
const crypto = require('crypto');
56
const jwa = require('jwa');
67

78
const ALGORITHMS = [
@@ -18,16 +19,6 @@ function toString(obj) {
1819
return JSON.stringify(obj);
1920
}
2021

21-
function merge(to, from) {
22-
for (var key in from)
23-
to[key] = from[key];
24-
return to;
25-
}
26-
27-
function makeError(opts) {
28-
return merge(new Error(opts.message||opts.code), opts);
29-
}
30-
3122
function jwsSecuredInput(header, payload) {
3223
const encodedHeader = base64url(toString(header));
3324
const encodedPayload = base64url(toString(payload));
@@ -113,7 +104,7 @@ function jwsDecode(jwsSig, opts) {
113104
header: header,
114105
payload: payload,
115106
signature: signatureFromJWS(jwsSig),
116-
}
107+
};
117108
}
118109

119110
function SignStream(opts) {
@@ -192,7 +183,7 @@ function DataStream(data) {
192183
this.emit('close');
193184
}.bind(this));
194185
}
195-
};
186+
}
196187
util.inherits(DataStream, Stream);
197188

198189
DataStream.prototype.write = function write(data) {

0 commit comments

Comments
 (0)