mirror of
https://github.com/fluencelabs/js-peer-id
synced 2025-06-29 18:51:48 +00:00
feat: add class-is module
This commit is contained in:
@ -39,6 +39,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"async": "^2.6.1",
|
"async": "^2.6.1",
|
||||||
|
"class-is": "^1.1.0",
|
||||||
"libp2p-crypto": "~0.13.0",
|
"libp2p-crypto": "~0.13.0",
|
||||||
"lodash": "^4.17.10",
|
"lodash": "^4.17.10",
|
||||||
"multihashes": "~0.4.13"
|
"multihashes": "~0.4.13"
|
||||||
|
@ -8,6 +8,7 @@ const mh = require('multihashes')
|
|||||||
const crypto = require('libp2p-crypto')
|
const crypto = require('libp2p-crypto')
|
||||||
const assert = require('assert')
|
const assert = require('assert')
|
||||||
const waterfall = require('async/waterfall')
|
const waterfall = require('async/waterfall')
|
||||||
|
const withIs = require('class-is')
|
||||||
|
|
||||||
class PeerId {
|
class PeerId {
|
||||||
constructor (id, privKey, pubKey) {
|
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
|
// generation
|
||||||
exports.create = function (opts, callback) {
|
exports.create = function (opts, callback) {
|
||||||
|
Reference in New Issue
Block a user