Skip to content

Commit 3a08c81

Browse files
author
Matt Gaunt
committed
Fixing eslint errors
1 parent 11f40ef commit 3a08c81

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

src/cli.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#! /usr/bin/env node
2-
const fs = require('fs');
2+
/* eslint consistent-return:0*/
3+
34
const webPush = require('../src/index.js');
45

56
const printUsageDetails = () => {
6-
const spc = ' ';
7-
87
const actions = [
98
{
109
name: 'send-notification',
@@ -45,7 +44,7 @@ const generateVapidKeys = returnJson => {
4544
if (returnJson) {
4645
outputText = JSON.stringify(vapidKeys);
4746
} else {
48-
const outputLine = '\n=======================================\n'
47+
const outputLine = '\n=======================================\n';
4948
outputText = outputLine + '\n' +
5049
'Public Key:\n' + vapidKeys.publicKey + '\n\n' +
5150
'Private Key:\n' + vapidKeys.privateKey + '\n' +
@@ -62,31 +61,31 @@ const sendNotification = args => {
6261
}
6362

6463
const subscription = {
65-
endpoint: argv.endpoint,
64+
endpoint: args.endpoint,
6665
keys: {
67-
p256dh: argv.key || null,
68-
auth: argv.auth || null
66+
p256dh: args.key || null,
67+
auth: args.auth || null
6968
}
7069
};
7170

72-
const payload = argv.payload || null;
71+
const payload = args.payload || null;
7372

7473
const options = {};
7574

76-
if (argv.ttl) {
77-
options.TTL = argv.ttl;
75+
if (args.ttl) {
76+
options.TTL = args.ttl;
7877
}
7978

8079
if (argv['vapid-subject'] || argv['vapid-pubkey'] || argv['vapid-pvtkey']) {
8180
options.vapidDetails = {
82-
subject: argv['vapid-subject'] || null,
83-
publicKey: argv['vapid-pubkey'] || null,
84-
privateKey: argv['vapid-pvtkey'] || null
85-
}
81+
subject: args['vapid-subject'] || null,
82+
publicKey: args['vapid-pubkey'] || null,
83+
privateKey: args['vapid-pvtkey'] || null
84+
};
8685
}
8786

88-
if (argv['gcm-api-key']) {
89-
options.gcmAPIKey = argv['gcm-api-key'];
87+
if (args['gcm-api-key']) {
88+
options.gcmAPIKey = args['gcm-api-key'];
9089
}
9190

9291
webPush.sendNotification(subscription, payload, options)

0 commit comments

Comments
 (0)