From 98594fd4e47e28717ee4cba022ecb1d8d78adf2c Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 30 Jun 2022 10:39:29 +0200 Subject: [PATCH] [Glitch] Remove dead code in WebUI filtering code Port 64588263f725a2d6e00e84347c21faedf3d18661 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/selectors/index.js | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/app/javascript/flavours/glitch/selectors/index.js b/app/javascript/flavours/glitch/selectors/index.js index 91f9a81d96..7caa5259fb 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;