mirror of https://codeberg.org/pzp/pzp-db.git
loosen tangle.slice() arguments
This commit is contained in:
parent
f38b293c76
commit
fa15271fdf
|
@ -140,11 +140,11 @@ class DBTangle extends MsgV3.Tangle {
|
|||
}
|
||||
|
||||
/**
|
||||
* @param {Array<string>} minSet
|
||||
* @param {Array<string>} maxSet
|
||||
* @param {Array<string>=} minSet
|
||||
* @param {Array<string>=} maxSet
|
||||
* @returns {Array<Msg>}
|
||||
*/
|
||||
slice(minSet, maxSet = []) {
|
||||
slice(minSet = [], maxSet = []) {
|
||||
const minSetGood = minSet.filter((msgID) => this.has(msgID))
|
||||
const maxSetGood = maxSet.filter((msgID) => this.has(msgID))
|
||||
const minSetTight = this.getMinimumAmong(minSetGood)
|
||||
|
|
|
@ -279,7 +279,7 @@ test('getTangle()', async (t) => {
|
|||
|
||||
await t.test('Tangle.slice', (t) => {
|
||||
{
|
||||
const msgs = tangle.slice([], [])
|
||||
const msgs = tangle.slice()
|
||||
const texts = msgs.map((msg) => msg.data?.text)
|
||||
assert.deepEqual(texts, [
|
||||
'root',
|
||||
|
|
Loading…
Reference in New Issue