From ce081bb4cb7ce5deef7f637e403b68509eae01d6 Mon Sep 17 00:00:00 2001 From: futpib Date: Sun, 2 Apr 2023 16:50:42 +0400 Subject: [PATCH] Rename pubkeys to profiles (NIP-10) --- nip10.test.js | 10 +++++----- nip10.ts | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nip10.test.js b/nip10.test.js index 5f882bb..1e17052 100644 --- a/nip10.test.js +++ b/nip10.test.js @@ -72,7 +72,7 @@ describe('parse NIP10-referenced events', () => { relays: [] } ], - pubkeys: [ + profiles: [ { pubkey: '77ce56f89d1228f7ff3743ce1ad1b254857b9008564727ebd5a1f317362f6ca7', @@ -137,7 +137,7 @@ describe('parse NIP10-referenced events', () => { relays: [] } ], - pubkeys: [ + profiles: [ { pubkey: '77ce56f89d1228f7ff3743ce1ad1b254857b9008564727ebd5a1f317362f6ca7', @@ -193,7 +193,7 @@ describe('parse NIP10-referenced events', () => { expect(nip10.parse(event)).toEqual({ mentions: [], - pubkeys: [ + profiles: [ { pubkey: '77ce56f89d1228f7ff3743ce1ad1b254857b9008564727ebd5a1f317362f6ca7', @@ -237,7 +237,7 @@ describe('parse NIP10-referenced events', () => { expect(nip10.parse(event)).toEqual({ mentions: [], - pubkeys: [ + profiles: [ { pubkey: '534780e44da7b494485e85cd4cca6af4f6caa1627472432b6f2a4ece0e9e54ec', @@ -306,7 +306,7 @@ describe('parse NIP10-referenced events', () => { expect(nip10.parse(event)).toEqual({ mentions: [], - pubkeys: [ + profiles: [ { pubkey: 'a8c21fcd8aa1f4befba14d72fc7a012397732d30d8b3131af912642f3c726f52', diff --git a/nip10.ts b/nip10.ts index eb0663d..73cb326 100644 --- a/nip10.ts +++ b/nip10.ts @@ -20,7 +20,7 @@ export type NIP10Result = { /** * List of pubkeys that are involved in the thread in no particular order. */ - pubkeys: ProfilePointer[] + profiles: ProfilePointer[] } export function parse(event: Pick): NIP10Result { @@ -28,7 +28,7 @@ export function parse(event: Pick): NIP10Result { reply: undefined, root: undefined, mentions: [], - pubkeys: [] + profiles: [] } const eTags: string[][] = [] @@ -39,7 +39,7 @@ export function parse(event: Pick): NIP10Result { } if (tag[0] === 'p' && tag[1]) { - result.pubkeys.push({ + result.profiles.push({ pubkey: tag[1], relays: tag[2] ? [tag[2]] : [] })