From 6513a02e1e80ea38da5ee3520d1ab4c6c9432e02 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Thu, 4 Oct 2018 11:29:31 +0100 Subject: [PATCH] feat: add class-is module --- package.json | 1 + src/index.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a2c72d0..07250e9 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ }, "dependencies": { "async": "^2.6.1", + "class-is": "^1.1.0", "libp2p-crypto": "~0.13.0", "lodash": "^4.17.10", "multihashes": "~0.4.13" diff --git a/src/index.js b/src/index.js index a9e7010..f526ed8 100644 --- a/src/index.js +++ b/src/index.js @@ -8,6 +8,7 @@ const mh = require('multihashes') const crypto = require('libp2p-crypto') const assert = require('assert') const waterfall = require('async/waterfall') +const withIs = require('class-is') class PeerId { constructor (id, privKey, pubKey) { @@ -132,7 +133,7 @@ class PeerId { } } -exports = module.exports = PeerId +exports = module.exports = withIs(PeerId, { className: 'PeerId', symbolName: '@libp2p/js-peer-id/PeerId' }) // generation exports.create = function (opts, callback) {