Skip to content

Commit c0eb76f

Browse files
committed
Fix linting issues
1 parent 0aa9a34 commit c0eb76f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

bin/web-push.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ const argv = require('minimist')(process.argv.slice(2));
77

88
const usage = 'Use: web-push --endpoint=<url> --key=<browser key> [--auth=<auth secret>] [--ttl=<seconds>] [--payload=<message>] [--vapid-audience] [--vapid-subject] [--vapid-pvtkey] [--vapid-pubkey]';
99

10-
if (!argv['endpoint'] || !argv['key']) {
10+
if (!argv.endpoint || !argv.key) {
1111
console.log(usage);
1212
process.exit(1);
1313
}
1414

15-
const endpoint = argv['endpoint'];
16-
const key = argv['key'];
17-
const ttl = argv['ttl'] || 0;
18-
const payload = argv['payload'] || '';
19-
const auth = argv['auth'] || null;
15+
const endpoint = argv.endpoint;
16+
const key = argv.key;
17+
const ttl = argv.ttl || 0;
18+
const payload = argv.payload || '';
19+
const auth = argv.auth || null;
2020
const vapidAudience = argv['vapid-audience'] || null;
2121
const vapidSubject = argv['vapid-subject'] || null;
2222
const vapidPubKey = argv['vapid-pubkey'] || null;
@@ -38,7 +38,7 @@ function getKeys() {
3838
return webPush.generateVAPIDKeys();
3939
}
4040

41-
var params = {
41+
let params = {
4242
TTL: ttl,
4343
payload,
4444
userPublicKey: key
@@ -49,12 +49,12 @@ if (vapidAudience && vapidSubject) {
4949
audience: vapidAudience,
5050
subject: `mailto:${vapidSubject}`,
5151
privateKey: vapidKeys.privateKey,
52-
publicKey: vapidKeys.publicKey,
52+
publicKey: vapidKeys.publicKey
5353
};
54-
params['vapid'] = vapid;
54+
params.vapid = vapid;
5555
}
5656
if (auth) {
57-
params['userAuth'] = auth;
57+
params.userAuth = auth;
5858
}
5959
webPush.sendNotification(endpoint, params).then(() => {
6060
console.log('Push message sent.');

0 commit comments

Comments
 (0)