Skip to content

Commit 9327111

Browse files
authored
Deps bump (#167)
Bump version to 1.5.0 Bump minimum node to latest supported LTS (12->18) Bump all possible deps, notably Telegraf to 4.13 string-replace-async and nedb-promise still need to be dealt with later
1 parent 3ac421e commit 9327111

File tree

4 files changed

+148
-103
lines changed

4 files changed

+148
-103
lines changed

handlers/middlewares/checkLinks.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const actionPriority = (action: Action) => action.type;
6767
const maxByActionPriority = R.maxBy(actionPriority);
6868
const highestPriorityAction = R.reduce(maxByActionPriority, Action.Nothing);
6969

70-
const assumeProtocol = R.unless(R.contains("://"), R.concat("http://"));
70+
const assumeProtocol = R.unless(R.includes("://"), R.concat("http://"));
7171
const isHttp = R.propSatisfies(R.test(/^https?:$/i), "protocol");
7272
const isLink = (entity: MessageEntity) =>
7373
["url", "text_link", "mention"].includes(entity.type);
@@ -162,7 +162,9 @@ const checkLinkByDomain = (url: URL) => {
162162
return handler(url);
163163
};
164164

165-
const classifyAsync = R.memoize(async (url: URL) => {
165+
const urlToKey = (url: URL) => url.toString();
166+
167+
const classifyAsync = R.memoizeWith(urlToKey, async (url: URL) => {
166168
if (isWhitelisted(url)) return Action.Nothing;
167169

168170
if (blacklisted.protocol(url)) return Action.Warn("Link using tg protocol");

0 commit comments

Comments
 (0)