Update welshman stuff, fix bug in makeFeed

This commit is contained in:
Jon Staab
2025-04-24 10:02:27 -07:00
parent 3a954201ce
commit c18b29e7d6
19 changed files with 60 additions and 47 deletions
-14
View File
@@ -2,20 +2,6 @@ import {hexToBytes, bytesToHex} from "@noble/hashes/utils"
import * as nip19 from "nostr-tools/nip19"
import {range, DAY} from "@welshman/lib"
export const displayList = <T>(xs: T[], conj = "and", n = 6, locale = "en-US") => {
const stringItems = xs.map(String)
if (xs.length > n + 2) {
const formattedList = new Intl.ListFormat(locale, {style: "long", type: "unit"}).format(
stringItems.slice(0, n),
)
return `${formattedList}, ${conj} ${xs.length - n} others`
}
return new Intl.ListFormat(locale, {style: "long", type: "conjunction"}).format(stringItems)
}
export const nsecEncode = (secret: string) => nip19.nsecEncode(hexToBytes(secret))
export const nsecDecode = (nsec: string) => {