mirror of https://codeberg.org/pzp/pzp-db.git
refactor isMoot()
This commit is contained in:
parent
cc1f83c064
commit
001fcaa1ab
|
@ -13,9 +13,10 @@ const { isEmptyObject } = require('./util')
|
||||||
function isMoot(msg, id = 0, findDomain = 0) {
|
function isMoot(msg, id = 0, findDomain = 0) {
|
||||||
const { dataHash, dataSize, account, accountTips, tangles, domain } =
|
const { dataHash, dataSize, account, accountTips, tangles, domain } =
|
||||||
msg.metadata
|
msg.metadata
|
||||||
|
if (msg.data !== null) return false
|
||||||
if (dataHash !== null) return false
|
if (dataHash !== null) return false
|
||||||
if (dataSize !== 0) return false
|
if (dataSize !== 0) return false
|
||||||
if (id === 0 && !account) return false
|
if (account === 'self') return false
|
||||||
if (id !== 0 && account !== stripAccount(id)) return false
|
if (id !== 0 && account !== stripAccount(id)) return false
|
||||||
if (accountTips !== null) return false
|
if (accountTips !== null) return false
|
||||||
if (!isEmptyObject(tangles)) return false
|
if (!isEmptyObject(tangles)) return false
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
"module": "node16",
|
"module": "node16",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"target": "es2021"
|
"target": "es2022"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue