remove unused code
This commit is contained in:
parent
6c8c7c27ed
commit
ad941bcdb1
1 changed files with 0 additions and 40 deletions
|
|
@ -200,28 +200,6 @@ const recipientToOutgoingID = async recipientPub => {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {string} userPub
|
|
||||||
* @returns {Promise<string|null>}
|
|
||||||
*/
|
|
||||||
const currHandshakeAddress = async userPub => {
|
|
||||||
const maybeAddr = await tryAndWait(async gun => {
|
|
||||||
const addr = await gun
|
|
||||||
.user(userPub)
|
|
||||||
.get(Key.CURRENT_HANDSHAKE_ADDRESS)
|
|
||||||
.then()
|
|
||||||
|
|
||||||
if (typeof addr !== 'string' && addr !== null) {
|
|
||||||
throw new TypeError('Expected handshake address to be string or null')
|
|
||||||
}
|
|
||||||
|
|
||||||
return addr
|
|
||||||
})
|
|
||||||
|
|
||||||
return typeof maybeAddr === 'string' ? maybeAddr : null
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @template T
|
* @template T
|
||||||
* @param {T[]} arr
|
* @param {T[]} arr
|
||||||
|
|
@ -284,22 +262,6 @@ const dataHasSoul = listenerData =>
|
||||||
*/
|
*/
|
||||||
const defaultName = pub => 'anon' + pub.slice(0, 8)
|
const defaultName = pub => 'anon' + pub.slice(0, 8)
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {string} pub
|
|
||||||
* @param {string} incomingID
|
|
||||||
* @returns {Promise<boolean>}
|
|
||||||
*/
|
|
||||||
const didDisconnect = async (pub, incomingID) => {
|
|
||||||
const feed = await require('../../Mediator/index')
|
|
||||||
.getGun()
|
|
||||||
.user(pub)
|
|
||||||
.get(Key.OUTGOINGS)
|
|
||||||
.get(incomingID)
|
|
||||||
.then()
|
|
||||||
|
|
||||||
return feed === null
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
asyncMap,
|
asyncMap,
|
||||||
asyncFilter,
|
asyncFilter,
|
||||||
|
|
@ -310,10 +272,8 @@ module.exports = {
|
||||||
recipientPubToLastReqSentID,
|
recipientPubToLastReqSentID,
|
||||||
successfulHandshakeAlreadyExists,
|
successfulHandshakeAlreadyExists,
|
||||||
recipientToOutgoingID,
|
recipientToOutgoingID,
|
||||||
currHandshakeAddress,
|
|
||||||
tryAndWait,
|
tryAndWait,
|
||||||
mySecret,
|
mySecret,
|
||||||
promisifyGunNode: require('./promisifygun'),
|
promisifyGunNode: require('./promisifygun'),
|
||||||
didDisconnect,
|
|
||||||
asyncForEach
|
asyncForEach
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue