Formatting

This commit is contained in:
Jon Staab
2025-04-29 09:47:11 -07:00
parent 8a153283de
commit dcf8569376
3 changed files with 9 additions and 6 deletions
+3 -1
View File
@@ -235,7 +235,9 @@ export const parseInvoice = (text: string, context: ParseContext): ParsedInvoice
export const parseLink = (text: string, context: ParseContext): ParsedLink | void => {
const prev = last(context.results)
let link = text.match(/^([a-z\+:]{2,30}:\/\/)?[-\.~\w]+\.[\w]{2,6}([^\s]*[^<>"'\.!,:\s\)\(]+)?/gi)?.[0]
const link = text.match(
/^([a-z\+:]{2,30}:\/\/)?[-\.~\w]+\.[\w]{2,6}([^\s]*[^<>"'\.!,:\s\)\(]+)?/gi,
)?.[0]
// 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(/\.\./)) {
+2 -4
View File
@@ -99,8 +99,7 @@ export const displayIntersectionFeed = (feed: IntersectionFeed) =>
export const displayGlobalFeed = (feed: GlobalFeed) => "anything"
export const displayKindFeed = (feed: KindFeed) =>
`of kind ${displayList(getFeedArgs(feed))}`
export const displayKindFeed = (feed: KindFeed) => `of kind ${displayList(getFeedArgs(feed))}`
export const displayListFeed = (feed: ListFeed) => {
const addresses = uniq(getFeedArgs(feed).flatMap(({addresses}) => addresses))
@@ -159,8 +158,7 @@ export const displayTagFeed = (feed: TagFeed) => {
return `with ${key} tag matching ${displayList(values, "or")}`
}
export const displayUnionFeed = (feed: UnionFeed) =>
displayList(getFeedArgs(feed).map(displayFeed))
export const displayUnionFeed = (feed: UnionFeed) => displayList(getFeedArgs(feed).map(displayFeed))
export const displayFeed = (feed: Feed): string => {
switch (feed[0]) {
+4 -1
View File
@@ -62,7 +62,10 @@ export const getCommentTags = (tags: string[][]) => {
}
export const getCommentTagValues = (tags: string[][]) =>
mapVals(tags => tags.filter(t => ['a', 'e'].includes(t[0].toLowerCase())).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[][]) => {
const validTags = tags.filter(t => ["a", "e", "q"].includes(t[0]))