From f90e4fea92a12576e7525e03bdf0304d62d36d1a Mon Sep 17 00:00:00 2001 From: Liam Mitchell Date: Sat, 11 May 2019 16:09:32 +1200 Subject: [PATCH] DEP0005 use Buffer.from See #123 --- packages/js-examples/addressbook.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/js-examples/addressbook.js b/packages/js-examples/addressbook.js index 38c0264..7932420 100644 --- a/packages/js-examples/addressbook.js +++ b/packages/js-examples/addressbook.js @@ -37,7 +37,7 @@ const Person_PhoneNumber_Type = addressbookSchemas.Person_PhoneNumber_Type; function writePackedMessageToStream(writeStream, message) { const arrayBuffer = message.toPackedArrayBuffer(); // Beacause streams can't handle ArrayBuffers - const buffer = new Buffer(arrayBuffer); + const buffer = Buffer.from(arrayBuffer); writeStream.write(buffer); }