mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-08 16:28:49 +00:00
Fix nip27 type
This commit is contained in:
4
nip27.ts
4
nip27.ts
@@ -13,7 +13,7 @@ export interface NostrURIMatch extends NostrURI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Find and decode all NIP-21 URIs. */
|
/** Find and decode all NIP-21 URIs. */
|
||||||
export function* matchAll(content: string): Iterable<NostrURIMatch> {
|
export function * matchAll(content: string): Iterable<NostrURIMatch> {
|
||||||
const matches = content.matchAll(regex())
|
const matches = content.matchAll(regex())
|
||||||
|
|
||||||
for (const match of matches) {
|
for (const match of matches) {
|
||||||
@@ -56,7 +56,7 @@ export function replaceAll(
|
|||||||
content: string,
|
content: string,
|
||||||
replacer: (match: NostrURI) => string
|
replacer: (match: NostrURI) => string
|
||||||
): string {
|
): string {
|
||||||
return content.replaceAll(regex(), (uri, value) => {
|
return content.replaceAll(regex(), (uri, value: string) => {
|
||||||
return replacer({
|
return replacer({
|
||||||
uri: uri as `nostr:${string}`,
|
uri: uri as `nostr:${string}`,
|
||||||
value,
|
value,
|
||||||
|
|||||||
Reference in New Issue
Block a user