Skip to content

Commit

Permalink
perf(deps): replace psl with tldts (#790)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL committed Dec 30, 2023
1 parent eabf5b9 commit 5d07522
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"lucide-react": "^0.302.0",
"md5.js": "^1.3.5",
"plasmo": "0.84.0",
"psl": "^1.9.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-hot-toast": "^2.4.1",
Expand All @@ -36,6 +35,7 @@
"rss-parser": "3.13.0",
"tailwind-merge": "^2.2.0",
"tailwindcss-animate": "^1.0.7",
"tldts": "^6.1.1",
"usehooks-ts": "^2.9.1",
"xss": "1.0.14"
},
Expand Down
21 changes: 14 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/lib/rsshub.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import psl from 'psl';
import { parse } from 'tldts';
import RouteRecognizer from 'route-recognizer';
import { parseRules } from './rules';
import type { Rule, RSSData } from './types';
Expand Down Expand Up @@ -78,7 +78,7 @@ export function getPageRSSHub(data: {

let parsedDomain;
try {
parsedDomain = psl.parse(new URL(url).hostname);
parsedDomain = parse(new URL(url).hostname);
} catch (error) {
return [];
}
Expand Down Expand Up @@ -186,7 +186,7 @@ export function getWebsiteRSSHub(data: {
const rules = parseRules(data.rules);
let parsedDomain;
try {
parsedDomain = psl.parse(new URL(url).hostname);
parsedDomain = parse(new URL(url).hostname);
} catch (error) {
return [];
}
Expand Down

0 comments on commit 5d07522

Please sign in to comment.