Skip to content

Commit

Permalink
syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-zhening-luo committed Jan 25, 2025
1 parent a36d492 commit 08a0fd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function process(host: Url["host"], path: string) {
"dropbox.com": path => !path.startsWith("/scl/fi/") ? path : (nodes => nodes.length < 4 ? path : nodes.slice(0, 4).join("/"))(path.split("/")),
"linkedin.com": path => path.startsWith("/mwlite/") ? path.slice(7) : path,
"reddit.com": path => (nodes => nodes.length < 6 || nodes[3] !== "comments" ? path : nodes.slice(0, nodes[5] === "comment" ? 7 : 5).join("/"))(path.split("/")),
} satisfies Record<string, (path: string) => string> as Url["host"], (path: string) => string>;
} satisfies Record<string, (path: string) => string> as Record<Url["host"], (path: string) => string>;

return processors[host]?.(path) ?? path;
}
Expand Down

0 comments on commit 08a0fd2

Please sign in to comment.