Skip to content

Commit 34a1d8d

Browse files
committed
kinds: more reliable regular/replaceable kind figuring.
1 parent d3ddd49 commit 34a1d8d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nostr/tools",
3-
"version": "2.18.0",
3+
"version": "2.18.1",
44
"exports": {
55
".": "./index.ts",
66
"./core": "./core.ts",

kinds.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { NostrEvent, validateEvent } from './pure.ts'
22

33
/** Events are **regular**, which means they're all expected to be stored by relays. */
44
export function isRegularKind(kind: number): boolean {
5-
return (1000 <= kind && kind < 10000) || [1, 2, 4, 5, 6, 7, 8, 16, 40, 41, 42, 43, 44].includes(kind)
5+
return kind < 10000 && kind !== 0 && kind !== 3
66
}
77

88
/** Events are **replaceable**, which means that, for each combination of `pubkey` and `kind`, only the latest event is expected to (SHOULD) be stored by relays, older versions are expected to be discarded. */
99
export function isReplaceableKind(kind: number): boolean {
10-
return [0, 3].includes(kind) || (10000 <= kind && kind < 20000)
10+
return kind === 0 || kind === 3 || (10000 <= kind && kind < 20000)
1111
}
1212

1313
/** Events are **ephemeral**, which means they are not expected to be stored by relays. */

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"type": "module",
33
"name": "nostr-tools",
4-
"version": "2.18.0",
4+
"version": "2.18.1",
55
"description": "Tools for making a Nostr client.",
66
"repository": {
77
"type": "git",

0 commit comments

Comments
 (0)