@joliegg/moderation 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -153,7 +153,7 @@ class ModerationClient {
153
153
  async moderateLink(url, allowShorteners = false) {
154
154
  try {
155
155
  const domain = new URL(url).hostname;
156
- const blacklisted = this.urlBlackList?.some(u => u.indexOf(url) > -1);
156
+ const blacklisted = this.urlBlackList?.some(u => url.indexOf(u) > -1);
157
157
  if (blacklisted) {
158
158
  return { source: url, moderation: [{ category: 'CUSTOM_BLACK_LIST', confidence: 100 }] };
159
159
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joliegg/moderation",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "A set of tools for chat moderation",
5
5
  "author": "Diana Islas Ocampo",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -190,7 +190,7 @@ class ModerationClient {
190
190
  try {
191
191
  const domain = new URL(url).hostname;
192
192
 
193
- const blacklisted = this.urlBlackList?.some(u => u.indexOf(url) > -1);
193
+ const blacklisted = this.urlBlackList?.some(u => url.indexOf(u) > -1);
194
194
 
195
195
  if (blacklisted) {
196
196
  return { source: url, moderation: [{ category: 'CUSTOM_BLACK_LIST', confidence: 100 }] };