about summary refs log tree commit diff
path: root/app/javascript
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-06-30 10:39:29 +0200
committerClaire <claire.github-309c@sitedethib.com>2022-08-25 09:52:13 +0200
commit93b6ad2c6c6d2b148d71bf3d4281313a331edb69 (patch)
tree8b2ff129a7fea1a2d7a2bfc39af3245fce8d8261 /app/javascript
parentbbafe28fbc31f333d526103990b0c0b5d73f7eaf (diff)
[Glitch] Remove dead code in WebUI filtering code
Port a233a9bfb5f384e89bdaef6e519fa20db2a99ae5 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript')
-rw-r--r--app/javascript/flavours/glitch/selectors/index.js27
1 files changed, 1 insertions, 26 deletions
diff --git a/app/javascript/flavours/glitch/selectors/index.js b/app/javascript/flavours/glitch/selectors/index.js
index 91f9a81d9..7caa5259f 100644
--- a/app/javascript/flavours/glitch/selectors/index.js
+++ b/app/javascript/flavours/glitch/selectors/index.js
@@ -1,6 +1,6 @@
 import escapeTextContentForBrowser from 'escape-html';
 import { createSelector } from 'reselect';
-import { List as ImmutableList, is } from 'immutable';
+import { List as ImmutableList } from 'immutable';
 import { me } from 'flavours/glitch/util/initial_state';
 
 const getAccountBase         = (state, id) => state.getIn(['accounts', id], null);
@@ -38,31 +38,6 @@ export 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;