From 60e0cbbe208f133102bdad2442e643d779829cc5 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Wed, 18 Mar 2020 12:20:05 +0000 Subject: [PATCH] fix: add buffer related to https://github.com/ipfs/js-ipfs/issues/2924 --- package.json | 1 + src/coder/encode.js | 1 + test/coder.spec.js | 1 + test/stream.spec.js | 1 + 4 files changed, 4 insertions(+) diff --git a/package.json b/package.json index f3ba0a7..26efba3 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "abort-controller": "^3.0.0", "abortable-iterator": "^3.0.0", "bl": "^4.0.0", + "buffer": "^5.5.0", "debug": "^4.1.1", "it-pipe": "^1.0.1", "it-pushable": "^1.3.1", diff --git a/src/coder/encode.js b/src/coder/encode.js index 58fa055..b02b7dd 100644 --- a/src/coder/encode.js +++ b/src/coder/encode.js @@ -1,5 +1,6 @@ 'use strict' +const { Buffer } = require('buffer') const varint = require('varint') const BufferList = require('bl/BufferList') diff --git a/test/coder.spec.js b/test/coder.spec.js index 051d1c1..75f5934 100644 --- a/test/coder.spec.js +++ b/test/coder.spec.js @@ -2,6 +2,7 @@ /* eslint max-nested-callbacks: ["error", 5] */ 'use strict' +const { Buffer } = require('buffer') const chai = require('chai') const dirtyChai = require('dirty-chai') const { BufferList } = require('bl') diff --git a/test/stream.spec.js b/test/stream.spec.js index 6ba6dc9..5c050b7 100644 --- a/test/stream.spec.js +++ b/test/stream.spec.js @@ -1,6 +1,7 @@ /* eslint-env mocha */ 'use strict' +const { Buffer } = require('buffer') const chai = require('chai') const dirtyChai = require('dirty-chai') const { expect } = chai