refactor secret-stack plugin shape

This commit is contained in:
Andre Staltz 2023-09-29 15:22:58 +03:00
parent 2f885fd807
commit 2d890eaba0
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
1 changed files with 336 additions and 338 deletions

View File

@ -63,15 +63,11 @@ function assertDBExists(peer) {
if (!peer.db) throw new Error('record plugin requires ppppp-db plugin') if (!peer.db) throw new Error('record plugin requires ppppp-db plugin')
} }
module.exports = {
name: 'record',
manifest: {},
/** /**
* @param {{ db: PPPPPDB | null, close: ClosableHook }} peer * @param {{ db: PPPPPDB | null, close: ClosableHook }} peer
* @param {any} config * @param {any} config
*/ */
init(peer, config) { function initRecord(peer, config) {
assertDBExists(peer) assertDBExists(peer)
//#region state //#region state
@ -420,5 +416,7 @@ module.exports = {
_squeezePotential, _squeezePotential,
} }
},
} }
exports.name = 'record'
exports.init = initRecord