From 738087e8a6e2249d2b700976f9c8b5318454b4bd Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Fri, 13 Mar 2020 14:00:36 +0000 Subject: [PATCH] fix: add buffer Adds buffer related to https://github.com/ipfs/js-ipfs/issues/2924 --- package.json | 3 ++- src/cid-util.js | 2 +- src/index.js | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7c44a2c..6f999e9 100644 --- a/package.json +++ b/package.json @@ -35,13 +35,14 @@ "url": "https://github.com/multiformats/js-cid/issues" }, "dependencies": { + "buffer": "^5.5.0", "class-is": "^1.1.0", "multibase": "~0.6.0", "multicodec": "^1.0.0", "multihashes": "~0.4.15" }, "devDependencies": { - "aegir": "^20.5.0", + "aegir": "^21.3.0", "chai": "^4.2.0", "dirty-chai": "^2.0.1", "multihashing": "~0.3.3", diff --git a/src/cid-util.js b/src/cid-util.js index 8a132ab..248407a 100644 --- a/src/cid-util.js +++ b/src/cid-util.js @@ -1,7 +1,7 @@ 'use strict' const mh = require('multihashes') - +const { Buffer } = require('buffer') var CIDUtil = { /** * Test if the given input is a valid CID object. diff --git a/src/index.js b/src/index.js index 0683ca7..c8c9cb7 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,6 @@ 'use strict' +const { Buffer } = require('buffer') const mh = require('multihashes') const multibase = require('multibase') const multicodec = require('multicodec')