Fix isDeleted
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
"dependencies": {
|
||||
"@welshman/lib": "0.0.11",
|
||||
"@welshman/net": "0.0.14",
|
||||
"@welshman/util": "0.0.16",
|
||||
"@welshman/util": "0.0.17",
|
||||
"nostr-tools": "^2.7.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,6 @@
|
||||
"typescript": "~5.1.6"
|
||||
},
|
||||
"dependencies": {
|
||||
"@welshman/util": "0.0.16"
|
||||
"@welshman/util": "0.0.17"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@welshman/lib": "0.0.11",
|
||||
"@welshman/util": "0.0.16",
|
||||
"@welshman/util": "0.0.17",
|
||||
"isomorphic-ws": "^5.0.0",
|
||||
"ws": "^8.16.0"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@welshman/util",
|
||||
"version": "0.0.16",
|
||||
"version": "0.0.17",
|
||||
"author": "hodlbod",
|
||||
"license": "MIT",
|
||||
"description": "A collection of nostr-related utilities.",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {flatten, Emitter, sortBy, inc, chunk, sleep, uniq, omit, now, range, identity} from '@welshman/lib'
|
||||
import {flatten, Emitter, max, sortBy, inc, chunk, sleep, uniq, omit, now, range, identity} from '@welshman/lib'
|
||||
import {DELETE} from './Kinds'
|
||||
import {EPOCH, matchFilter} from './Filters'
|
||||
import {isReplaceable, isTrustedEvent} from './Events'
|
||||
@@ -202,15 +202,8 @@ export class Repository extends Emitter {
|
||||
}
|
||||
}
|
||||
|
||||
isDeleted = (event: TrustedEvent) => {
|
||||
const deletedAt = (
|
||||
this.deletes.get(event.id) ||
|
||||
this.deletes.get(getAddress(event)) ||
|
||||
0
|
||||
)
|
||||
|
||||
return deletedAt > event.created_at
|
||||
}
|
||||
isDeleted = (event: TrustedEvent) =>
|
||||
max([this.deletes.get(event.id) || 0, this.deletes.get(getAddress(event)) || 0]) > event.created_at
|
||||
|
||||
// Utilities
|
||||
|
||||
|
||||
Reference in New Issue
Block a user