Skip to content

Commit

Permalink
Got rid of node Buffer() deprecation warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyanziano committed Apr 15, 2019
1 parent 413cfd5 commit 8626e18
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export default function getAttachmentInfo(botEmulator: BotEmulator) {
if (attachment.originalBase64) {
attachmentInfo.views.push({
viewId: 'original',
size: new Buffer(attachment.originalBase64, 'base64').length,
size: Buffer.from(attachment.originalBase64, 'base64').length,
});
}

if (attachment.thumbnailBase64) {
attachmentInfo.views.push({
viewId: 'thumbnail',
size: new Buffer(attachment.thumbnailBase64, 'base64').length,
size: Buffer.from(attachment.thumbnailBase64, 'base64').length,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function startConversation(botEmulator: BotEmulator) {
const botEndpoint: BotEndpoint = (req as any).botEndpoint;
const conversationId =
onErrorResumeNext(() => {
const optionsJson = new Buffer(tokenMatch[1], 'base64').toString('utf8');
const optionsJson = Buffer.from(tokenMatch[1], 'base64').toString('utf8');

return JSON.parse(optionsJson).conversationId;
}) || uniqueId();
Expand Down
6 changes: 3 additions & 3 deletions packages/emulator/core/src/facility/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,12 @@ export default class Conversation extends EventEmitter {
};

const paymentTokenHeaderStr = JSON.stringify(paymentTokenHeader);
const pthBytes = new Buffer(paymentTokenHeaderStr).toString('base64');
const pthBytes = Buffer.from(paymentTokenHeaderStr).toString('base64');

const paymentTokenSource = 'tok_18yWDMKVgMv7trmwyE21VqO';
const ptsBytes = new Buffer(paymentTokenSource).toString('base64');
const ptsBytes = Buffer.from(paymentTokenSource).toString('base64');

const ptsigBytes = new Buffer('Emulator').toString('base64');
const ptsigBytes = Buffer.from('Emulator').toString('base64');

const updateValue: PaymentRequestComplete = {
id: request.id,
Expand Down

0 comments on commit 8626e18

Please sign in to comment.