Skip to content

Commit

Permalink
Delete lodash dependency in examples (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
duvan-gallego authored and childish-sambino committed Aug 27, 2019
1 parent 9026774 commit 93cd151
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions examples/example.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
'use strict';

var _ = require('lodash');
var Twilio = require('../lib');

var accountSid = process.env.TWILIO_ACCOUNT_SID;
Expand Down Expand Up @@ -116,7 +115,7 @@ promise.then(function(trunk) {
// List messages using callbacks
twilio.messages.list(function(err, messages) {
console.log('Listing messages using callbacks');
_.each(messages, function(message) {
messages.forEach(function (message) {
console.log(message.sid);
});
});
Expand All @@ -125,7 +124,7 @@ twilio.messages.list(function(err, messages) {
promise = twilio.messages.list();
promise.then(function(messages) {
console.log('Listing messages using promises');
_.each(messages, function(message) {
messages.forEach(function (message) {
console.log(message.sid);
});
});
9 changes: 4 additions & 5 deletions examples/typescript/example.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as _ from 'lodash';
import twilio = require('../../');
import {MessageListInstanceCreateOptions} from '../../lib/rest/api/v2010/account/message';

Expand Down Expand Up @@ -114,18 +113,18 @@ promiseTrunk3.then(trunk => {
// List messages using callbacks
client.messages.list({}, (err, messages) => {
console.log('Listing messages using callbacks');
_.each(messages, message => {
messages.forEach(function(message){
console.log(message.sid);
});
});
});

// List messages using promises
const promiseMessage = client.messages.list();
promiseMessage.then(messages => {
console.log('Listing messages using promises');
_.each(messages, function(message) {
messages.forEach(function(message){
console.log(message.sid);
});
});
});

const twiml = new twilio.twiml.VoiceResponse();
Expand Down

0 comments on commit 93cd151

Please sign in to comment.