Fix comment tag values

This commit is contained in:
Jon Staab
2025-04-29 09:18:34 -07:00
parent 8ce0abbccd
commit ed10a620a7
5 changed files with 21 additions and 4 deletions
+1 -2
View File
@@ -235,8 +235,7 @@ export const parseInvoice = (text: string, context: ParseContext): ParsedInvoice
export const parseLink = (text: string, context: ParseContext): ParsedLink | void => { export const parseLink = (text: string, context: ParseContext): ParsedLink | void => {
const prev = last(context.results) const prev = last(context.results)
const [link] = let link = text.match(/^([a-z\+:]{2,30}:\/\/)?[-\.~\w]+\.[\w]{2,6}([^\s]*[^<>"'\.!,:\s\)\(]+)?/gi)?.[0]
text.match(/^([a-z\+:]{2,30}:\/\/)?[-\.~\w]+\.[\w]{2,6}([^\s]*[^<>"'\.!,:\s\)\(]+)?/gi) || []
// Skip url if it's just the end of a filepath or an ellipse // Skip url if it's just the end of a filepath or an ellipse
if (!link || (prev?.type === ParsedType.Text && prev.value.endsWith("/")) || link.match(/\.\./)) { if (!link || (prev?.type === ParsedType.Text && prev.value.endsWith("/")) || link.match(/\.\./)) {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@welshman/util", "name": "@welshman/util",
"version": "0.2.0", "version": "0.2.1",
"author": "hodlbod", "author": "hodlbod",
"license": "MIT", "license": "MIT",
"description": "A collection of nostr-related utilities.", "description": "A collection of nostr-related utilities.",
+1
View File
@@ -121,6 +121,7 @@ export const INBOX_RELAYS = 10050
export const FILE_SERVERS = 10096 export const FILE_SERVERS = 10096
export const LIGHTNING_PUB_RPC = 21000 export const LIGHTNING_PUB_RPC = 21000
export const CLIENT_AUTH = 22242 export const CLIENT_AUTH = 22242
export const BLOSSOM_AUTH = 24242
export const AUTH_JOIN = 28934 export const AUTH_JOIN = 28934
export const AUTH_INVITE = 28935 export const AUTH_INVITE = 28935
export const WALLET_INFO = 13194 export const WALLET_INFO = 13194
+1 -1
View File
@@ -62,7 +62,7 @@ export const getCommentTags = (tags: string[][]) => {
} }
export const getCommentTagValues = (tags: string[][]) => export const getCommentTagValues = (tags: string[][]) =>
mapVals(tags => tags.map(nth(1)), getCommentTags(tags)) mapVals(tags => tags.filter(t => ['a', 'e'].includes(t[0].toLowerCase())).map(nth(1)), getCommentTags(tags))
export const getReplyTags = (tags: string[][]) => { export const getReplyTags = (tags: string[][]) => {
const validTags = tags.filter(t => ["a", "e", "q"].includes(t[0])) const validTags = tags.filter(t => ["a", "e", "q"].includes(t[0]))
Executable
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash
status=$(git status | grep "nothing to commit")
if [[ -z "$status" ]]; then
echo "Can't tag with uncommitted changes"
exit 1
fi
for pkg in $(ls packages); do
version=$(sed -nr 's/ +"version": "(.+)",/\1/p' packages/$pkg/package.json)
git tag "$pkg/$version" >/dev/null 2>&1
done
git push
git push --tags