mirror of https://codeberg.org/pzp/pzp-promise.git
update secret-stack to 8.1
This commit is contained in:
parent
000dd016f4
commit
fe3487c5ba
22
lib/index.js
22
lib/index.js
|
@ -22,22 +22,6 @@ const b4a = require('b4a')
|
|||
* @typedef {(...args: [NodeJS.ErrnoException] | [null, T]) => void} CB<T>
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {{ db: PPPPPDB | null }} peer
|
||||
* @returns {asserts peer is { db: PPPPPDB }}
|
||||
*/
|
||||
function assertDBPlugin(peer) {
|
||||
if (!peer.db) throw new Error('"promise" plugin requires "db" plugin')
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {{ set: PPPPPSet | null }} peer
|
||||
* @returns {asserts peer is { set: PPPPPSet }}
|
||||
*/
|
||||
function assertSetPlugin(peer) {
|
||||
if (!peer.set) throw new Error('"promise" plugin requires "set" plugin')
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Config} config
|
||||
* @returns {asserts config is ExpectedConfig}
|
||||
|
@ -49,11 +33,10 @@ function assertValidConfig(config) {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param {{ db: PPPPPDB | null; set: PPPPPSet | null }} peer
|
||||
* @param {{ db: PPPPPDB; set: PPPPPSet }} peer
|
||||
* @param {Config} config
|
||||
*/
|
||||
function initPromise(peer, config) {
|
||||
assertDBPlugin(peer)
|
||||
assertValidConfig(config)
|
||||
const devicePromisesFile = Path.join(config.global.path, 'promises.json')
|
||||
|
||||
|
@ -147,7 +130,6 @@ function initPromise(peer, config) {
|
|||
return
|
||||
}
|
||||
try {
|
||||
assertSetPlugin(peer)
|
||||
} catch (err) {
|
||||
cb(/**@type {Error}*/ (err))
|
||||
return
|
||||
|
@ -198,7 +180,6 @@ function initPromise(peer, config) {
|
|||
}
|
||||
|
||||
try {
|
||||
assertDBPlugin(peer)
|
||||
} catch (err) {
|
||||
cb(/**@type {Error}*/ (err))
|
||||
return
|
||||
|
@ -296,6 +277,7 @@ function initPromise(peer, config) {
|
|||
}
|
||||
|
||||
exports.name = 'promise'
|
||||
exports.needs = ['db', 'set']
|
||||
exports.manifest = {
|
||||
// management
|
||||
create: 'async',
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
"pretty-quick": "^3.1.3",
|
||||
"rimraf": "^5.0.1",
|
||||
"secret-handshake-ext": "0.0.11",
|
||||
"secret-stack": "~8.0.0",
|
||||
"secret-stack": "~8.1.0",
|
||||
"typescript": "^5.1.3"
|
||||
},
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in New Issue