mirror of https://codeberg.org/pzp/pzp-db.git
refactor: simplify some code in MsgV3
This commit is contained in:
parent
accc41a68c
commit
9223402335
|
@ -151,7 +151,6 @@ function create(opts) {
|
||||||
const accountTips = opts.accountTips ? opts.accountTips.sort() : null
|
const accountTips = opts.accountTips ? opts.accountTips.sort() : null
|
||||||
|
|
||||||
const tangles = /** @type {Msg['metadata']['tangles']} */ ({})
|
const tangles = /** @type {Msg['metadata']['tangles']} */ ({})
|
||||||
if (opts.tangles) {
|
|
||||||
for (const rootID in opts.tangles) {
|
for (const rootID in opts.tangles) {
|
||||||
if ((err = validateMsgID(rootID))) throw err
|
if ((err = validateMsgID(rootID))) throw err
|
||||||
const tangle = opts.tangles[rootID]
|
const tangle = opts.tangles[rootID]
|
||||||
|
@ -160,7 +159,6 @@ function create(opts) {
|
||||||
const prev = [...union(lipmaaSet, tangle.tips)].sort()
|
const prev = [...union(lipmaaSet, tangle.tips)].sort()
|
||||||
tangles[rootID] = { depth, prev }
|
tangles[rootID] = { depth, prev }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/** @type {Msg} */
|
/** @type {Msg} */
|
||||||
const msg = {
|
const msg = {
|
||||||
|
|
Loading…
Reference in New Issue