Skip to content

Commit cd580a4

Browse files
dkundelwell1791
authored andcommitted
Apply automatic ESLint changes based on arrow functions
1 parent bb5bfd8 commit cd580a4

File tree

484 files changed

+910
-938
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

484 files changed

+910
-938
lines changed

client/accept-call/accept-call.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Twilio.Device.incoming(function(conn) {
1+
Twilio.Device.incoming(conn => {
22
console.log('Incoming connection from ' + conn.parameters.From);
33
// accept the incoming connection and start two-way audio
44
conn.accept();

client/capability-token-2way/capability-token.2.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const twilio = require('twilio');
66
const app = express();
77
app.use(bodyParser.urlencoded({ extended: false }));
88

9-
app.get('/token', function(req, res) {
9+
app.get('/token', (req, res) => {
1010
// put your Twilio API credentials here
1111
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
1212
const authToken = 'your_auth_token';
@@ -23,7 +23,7 @@ app.get('/token', function(req, res) {
2323
res.send(token);
2424
});
2525

26-
app.post('/voice', function(req, res) {
26+
app.post('/voice', (req, res) => {
2727
// TODO: Create TwiML response
2828
});
2929

client/capability-token-incoming/capability-token.2.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const twilio = require('twilio');
44

55
const app = express();
66

7-
app.get('/token', function(req, res) {
7+
app.get('/token', (req, res) => {
88
// put your Twilio API credentials here
99
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
1010
const authToken = 'your_auth_token';
@@ -17,7 +17,7 @@ app.get('/token', function(req, res) {
1717
res.send(token);
1818
});
1919

20-
app.post('/voice', function(req, res) {
20+
app.post('/voice', (req, res) => {
2121
// TODO: Create TwiML response
2222
});
2323

client/capability-token-outgoing/capability-token.2.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const twilio = require('twilio');
44

55
const app = express();
66

7-
app.get('/token', function(req, res) {
7+
app.get('/token', (req, res) => {
88
// put your Twilio API credentials here
99
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
1010
const authToken = 'your_auth_token';
@@ -20,7 +20,7 @@ app.get('/token', function(req, res) {
2020
res.send(token);
2121
});
2222

23-
app.post('/voice', function(req, res) {
23+
app.post('/voice', (req, res) => {
2424
// TODO: Create TwiML response
2525
});
2626

client/capability-token/capability-token.2.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const twilio = require('twilio');
44

55
const app = express();
66

7-
app.get('/token', function(req, res) {
7+
app.get('/token', (req, res) => {
88
// put your Twilio API credentials here
99
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
1010
const authToken = 'your_auth_token';
@@ -21,7 +21,7 @@ app.get('/token', function(req, res) {
2121
res.send(token);
2222
});
2323

24-
app.post('/voice', function(req, res) {
24+
app.post('/voice', (req, res) => {
2525
// TODO: Create TwiML response
2626
});
2727

client/create-device/create-device.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Twilio.Device.setup(token);
22

3-
Twilio.Device.ready(function(device) {
3+
Twilio.Device.ready(device => {
44
console.log('Ready');
55
});
66

7-
Twilio.Device.error(function(error) {
7+
Twilio.Device.error(error => {
88
console.log('Error: ' + error.message);
99
});

client/reject-call/reject-call.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Twilio.Device.incoming(function(conn) {
1+
Twilio.Device.incoming(conn => {
22
console.log('Incoming connection from ' + conn.parameters.From);
33
const archEnemyPhoneNumber = '+15417280966';
44

client/request-token/request-token.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
$(function() {
1+
$(() => {
22
$.ajax('/token')
3-
.done(function(token) {
3+
.done(token => {
44
console.log('Got a token: ', token);
55
// TODO: Use token with Twilio Client
66
})
7-
.fail(function() {
7+
.fail(() => {
88
alert('Could not authenticate!');
99
});
1010
});

client/response-twiml-client/response-twiml-client.2.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const twilio = require('twilio');
66
const app = express();
77
app.use(bodyParser.urlencoded({ extended: false }));
88

9-
app.post('/voice', function(req, res) {
9+
app.post('/voice', (req, res) => {
1010
// Create TwiML response
1111
const twiml = new twilio.TwimlResponse();
1212

@@ -28,7 +28,7 @@ app.post('/voice', function(req, res) {
2828
res.send(twiml.toString());
2929
});
3030

31-
app.get('/token', function(req, res) {
31+
app.get('/token', (req, res) => {
3232
// TODO: generate token
3333
});
3434

client/response-twiml-dial/response-twiml-dial.2.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const twilio = require('twilio');
66
const app = express();
77
app.use(bodyParser.urlencoded({ extended: false }));
88

9-
app.post('/voice', function(req, res) {
9+
app.post('/voice', (req, res) => {
1010
// Create TwiML response
1111
const twiml = new twilio.TwimlResponse();
1212

@@ -22,7 +22,7 @@ app.post('/voice', function(req, res) {
2222
res.send(twiml.toString());
2323
});
2424

25-
app.get('/token', function(req, res) {
25+
app.get('/token', (req, res) => {
2626
// TODO: generate token
2727
});
2828

client/response-twiml/response-twiml.2.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const twilio = require('twilio');
44

55
const app = express();
66

7-
app.post('/voice', function(req, res) {
7+
app.post('/voice', (req, res) => {
88
// Create TwiML response
99
const twiml = new twilio.TwimlResponse();
1010
twiml.say('Thanks for calling!');
@@ -13,7 +13,7 @@ app.post('/voice', function(req, res) {
1313
res.send(twiml.toString());
1414
});
1515

16-
app.get('/token', function(req, res) {
16+
app.get('/token', (req, res) => {
1717
// TODO: generate token
1818
});
1919

fax/basic-send/basic-send.3.x.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ client.fax.v1.faxes
1010
from: '+15017250604',
1111
mediaUrl: 'https://www.twilio.com/docs/documents/25/justthefaxmaam.pdf',
1212
})
13-
.then(function(response) {
13+
.then(response => {
1414
console.log(response.sid);
1515
})
1616
.catch(err => {

fax/instance-get-example/instance-get-example.3.x.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const client = require('twilio')(accountSid, authToken);
77
client.fax.v1
88
.faxes('FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
99
.fetch()
10-
.then(function(response) {
10+
.then(response => {
1111
console.log(response.sid);
1212
})
1313
.catch(err => {

fax/instance-post-example/instance-post-example.3.x.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ client.fax.v1
99
.update({
1010
status: 'canceled',
1111
})
12-
.then(function(response) {
12+
.then(response => {
1313
console.log(response.sid);
1414
})
1515
.catch(err => {

fax/list-get-example/list-get-example.3.x.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const client = require('twilio')(accountSid, authToken);
66

77
client.fax.v1.faxes
88
.list()
9-
.then(function(response) {
9+
.then(response => {
1010
console.log(response);
1111
})
1212
.catch(err => {

fax/sip-send/example-1/example-1.3.x.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ client.fax.v1.faxes
1010
from: 'Jack',
1111
mediaUrl: 'https://www.twilio.com/docs/documents/25/justthefaxmaam.pdf',
1212
})
13-
.then(function(response) {
13+
.then(response => {
1414
console.log(response.sid);
1515
});

fax/sip-send/example-2/example-2.3.x.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ client.fax.v1.faxes
1212
sipAuthUsername: 'jack',
1313
sipAuthPassword: 'secret',
1414
})
15-
.then(function(response) {
15+
.then(response => {
1616
console.log(response.sid);
1717
})
1818
.catch(err => {

fax/sip-send/example-3/example-3.3.x.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ client.fax.v1.faxes
1010
from: 'Jack',
1111
mediaUrl: 'https://www.twilio.com/docs/documents/25/justthefaxmaam.pdf',
1212
})
13-
.then(function(response) {
13+
.then(response => {
1414
console.log(response.sid);
1515
})
1616
.catch(err => {

guides/voice/conference-calls-guide/moderated-conference/moderated-conference.2.x.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ app.post('/voice', (request, response) => {
2020
const twiml = new twilio.TwimlResponse();
2121

2222
// Start with a <Dial> verb
23-
twiml.dial(function(dialNode) {
23+
twiml.dial(dialNode => {
2424
// If the caller is our MODERATOR, then start the conference when they
2525
// join and end the conference when they leave
2626
if (request.body.From == MODERATOR) {

guides/voice/record-calls-guide/record-outgoing-call/example-1.2.x.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ client.calls.create(
1111
from: '+15017250604',
1212
record: 'true',
1313
},
14-
function(err, call) {
14+
(err, call) => {
1515
process.stdout.write(call.sid);
1616
}
1717
);

ip-messaging/channels/accept-invite/accept-invite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Listen for new invitations to your Client
2-
chatClient.on('channelInvited', function(channel) {
2+
chatClient.on('channelInvited', channel => {
33
console.log('Invited to channel ' + channel.friendlyName);
44
// Join the channel that you were invited to
55
channel.join();

ip-messaging/channels/create-channel/create-channel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ chatClient
44
uniqueName: 'general',
55
friendlyName: 'General Chat Channel',
66
})
7-
.then(function(channel) {
7+
.then(channel => {
88
console.log('Created general channel:');
99
console.log(channel);
1010
});
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Delete a previously created Channel
2-
myChannel.delete().then(function(channel) {
2+
myChannel.delete().then(channel => {
33
console.log('Deleted channel: ' + channel.sid);
44
});
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// A channel has become visible to the Client
2-
chatClient.on('channelAdded', function(channel) {
2+
chatClient.on('channelAdded', channel => {
33
console.log('Channel added: ' + channel.friendlyName);
44
});
55
// A channel is no longer visible to the Client
6-
chatClient.on('channelRemoved', function(channel) {
6+
chatClient.on('channelRemoved', channel => {
77
console.log('Channel removed: ' + channel.friendlyName);
88
});
99
// A channel's attributes or metadata have changed.
10-
chatClient.on('channelUpdated', function(channel) {
10+
chatClient.on('channelUpdated', channel => {
1111
console.log('Channel updates: ' + channel.sid);
1212
});
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// Listen for members joining a channel
2-
myChannel.on('memberJoined', function(member) {
2+
myChannel.on('memberJoined', member => {
33
console.log(member.identity + 'has joined the channel.');
44
});
55
// Listen for members user info changing
6-
myChannel.on('memberInfoUpdated', function(member) {
6+
myChannel.on('memberInfoUpdated', member => {
77
console.log(member.identity + 'updated their info.');
88
});
99
// Listen for members leaving a channel
10-
myChannel.on('memberLeft', function(member) {
10+
myChannel.on('memberLeft', member => {
1111
console.log(member.identity + 'has left the channel.');
1212
});
1313
// Listen for members typing
14-
myChannel.on('typingStarted', function(member) {
14+
myChannel.on('typingStarted', member => {
1515
console.log(member.identity + 'is currently typing.');
1616
});
1717
// Listen for members typing
18-
myChannel.on('typingEnded', function(member) {
18+
myChannel.on('typingEnded', member => {
1919
console.log(member.identity + 'has stopped typing.');
2020
});

ip-messaging/channels/get-messages/get-messages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Get Messages for a previously created channel
2-
channel.getMessages().then(function(messages) {
2+
channel.getMessages().then(messages => {
33
const totalMessages = messages.items.length;
44
for (i = 0; i < totalMessages; i++) {
55
const message = messages.items[i];

ip-messaging/channels/list-public-channels/list-public-channels.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
chatClient.getPublicChannelDescriptors().then(function(paginator) {
1+
chatClient.getPublicChannelDescriptors().then(paginator => {
22
for (i = 0; i < paginator.items.length; i++) {
33
const channel = paginator.items[i];
44
console.log('Channel: ' + channel.friendlyName);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Listen for new messages sent to a channel
2-
myChannel.on('messageAdded', function(message) {
2+
myChannel.on('messageAdded', message => {
33
console.log(message.author, message.body);
44
});

ip-messaging/channels/retrieve-channels/retrieve-channels.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
chatClient.getSubscribedChannels().then(function(paginator) {
1+
chatClient.getSubscribedChannels().then(paginator => {
22
for (i = 0; i < paginator.items.length; i++) {
33
const channel = paginator.items[i];
44
console.log('Channel: ' + channel.friendlyName);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Invite another member to your channel
2-
myChannel.invite('elmo').then(function() {
2+
myChannel.invite('elmo').then(() => {
33
console.log('Your friend has been invited!');
44
});

ip-messaging/consumption/message-read-status/message-read-status.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// retrieve the list of members for the active channel
22
const members = activeChannel.getMembers();
33
// for each member, set up a listener for when the member is updated
4-
members.then(function(currentMembers) {
5-
currentMembers.forEach(function(member) {
4+
members.then(currentMembers => {
5+
currentMembers.forEach(member => {
66
// handle the read status information for this member
77
// note this method would use the provided information
88
// to render this to the user in some way

ip-messaging/consumption/message-update-listener/message-update-listener.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// this code assumes you have a variable names activeChannel for the
22
// currently active channel in the UI
3-
activeChannel.on('memberUpdated', function(member) {
3+
activeChannel.on('memberUpdated', member => {
44
// note this method would use the provided information
55
// to render this to the user in some way
66
updateMemberMessageReadStatus(

ip-messaging/reachability-indicator/disable-indicator/disable-indicator.3.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ client.chat
99
.update({
1010
reachabilityEnabled: 'false',
1111
})
12-
.then(function(response) {
12+
.then(response => {
1313
console.log(response);
1414
})
15-
.catch(function(error) {
15+
.catch(error => {
1616
console.log(error);
1717
});

ip-messaging/reachability-indicator/enable-indicator/enable-indicator.3.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ client.chat
99
.update({
1010
reachabilityEnabled: 'true',
1111
})
12-
.then(function(response) {
12+
.then(response => {
1313
console.log(response);
1414
})
15-
.catch(function(error) {
15+
.catch(error => {
1616
console.log(error);
1717
});

ip-messaging/rest/channels/create-channels/create-channels.2.x.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ service.channels
99
.create({
1010
friendlyName: 'MyChannel',
1111
})
12-
.then(function(response) {
12+
.then(response => {
1313
console.log(response);
1414
})
15-
.fail(function(error) {
15+
.fail(error => {
1616
console.log(error);
1717
});

0 commit comments

Comments
 (0)