diff --git a/nip27.test.js b/nip27.test.js index f7436fd..2946722 100644 --- a/nip27.test.js +++ b/nip27.test.js @@ -1,8 +1,8 @@ /* eslint-env jest */ const {nip27} = require('./lib/nostr.cjs') -test('find', () => { - const result = nip27.find( +test('matchAll', () => { + const result = nip27.matchAll( 'Hello nostr:npub108pv4cg5ag52nq082kd5leu9ffrn2gdg6g4xdwatn73y36uzplmq9uyev6!\n\nnostr:note1gmtnz6q2m55epmlpe3semjdcq987av3jvx4emmjsa8g3s9x7tg4sclreky' ) diff --git a/nip27.ts b/nip27.ts index 5ebd49f..00bcad4 100644 --- a/nip27.ts +++ b/nip27.ts @@ -14,7 +14,7 @@ export interface NostrURIMatch extends nip21.NostrURI { } /** Find and decode all NIP-21 URIs. */ -export function find(content: string): NostrURIMatch[] { +export function matchAll(content: string): NostrURIMatch[] { const matches = content.matchAll(regex()) return [...matches].map(match => {