about summary refs log tree commit diff
path: root/app/javascript/mastodon/selectors/index.js
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-06-30 10:39:29 +0200
committerGitHub <noreply@github.com>2022-06-30 10:39:29 +0200
commita233a9bfb5f384e89bdaef6e519fa20db2a99ae5 (patch)
tree3af0b59f61be5738e680a6fb1866b633e365a764 /app/javascript/mastodon/selectors/index.js
parent3c24f19afedc2169a7a343c5af4a8f892d863f0b (diff)
Remove dead code in WebUI filtering code (#18745)
Diffstat (limited to 'app/javascript/mastodon/selectors/index.js')
-rw-r--r--app/javascript/mastodon/selectors/index.js27
1 files changed, 1 insertions, 26 deletions
diff --git a/app/javascript/mastodon/selectors/index.js b/app/javascript/mastodon/selectors/index.js
index bf1db4bb4..187e3306d 100644
--- a/app/javascript/mastodon/selectors/index.js
+++ b/app/javascript/mastodon/selectors/index.js
@@ -1,5 +1,5 @@
 import { createSelector } from 'reselect';
-import { List as ImmutableList, Map as ImmutableMap, is } from 'immutable';
+import { List as ImmutableList, Map as ImmutableMap } from 'immutable';
 import { me } from '../initial_state';
 
 const getAccountBase         = (state, id) => state.getIn(['accounts', id], null);
@@ -37,31 +37,6 @@ const toServerSideType = columnType => {
   }
 };
 
-const escapeRegExp = string =>
-  string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
-
-const regexFromKeywords = keywords => {
-  if (keywords.size === 0) {
-    return null;
-  }
-
-  return new RegExp(keywords.map(keyword_filter => {
-    let expr = escapeRegExp(keyword_filter.get('keyword'));
-
-    if (keyword_filter.get('whole_word')) {
-      if (/^[\w]/.test(expr)) {
-        expr = `\\b${expr}`;
-      }
-
-      if (/[\w]$/.test(expr)) {
-        expr = `${expr}\\b`;
-      }
-    }
-
-    return expr;
-  }).join('|'), 'i');
-};
-
 const getFilters = (state, { contextType }) => {
   if (!contextType) return null;