From 6a037d16588ed865394bc1d7f5fa35069cd94d07 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 22 Apr 2023 19:06:53 -0500 Subject: [PATCH] nip27.find --> nip27.matchAll --- nip27.test.js | 4 ++-- nip27.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 => {