« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/common-util/search-shape.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/common-util/search-shape.js')
-rw-r--r--src/common-util/search-shape.js46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/common-util/search-shape.js b/src/common-util/search-shape.js
index 7f81a089..e0819ed6 100644
--- a/src/common-util/search-shape.js
+++ b/src/common-util/search-shape.js
@@ -56,49 +56,3 @@ export function makeSearchIndex(descriptor, {FlexSearch}) {
     resolution: 1,
   });
 }
-
-// TODO: This function basically mirrors bind-utilities.js, which isn't
-// exactly robust, but... binding might need some more thought across the
-// codebase in *general.*
-function bindSearchUtilities({
-  checkIfImagePathHasCachedThumbnails,
-  getThumbnailEqualOrSmaller,
-  thumbsCache,
-  urls,
-}) {
-  // TODO: :boom:
-
-  const bound = {
-    urls,
-  };
-
-  bound.checkIfImagePathHasCachedThumbnails =
-    (imagePath) =>
-      checkIfImagePathHasCachedThumbnails(imagePath, thumbsCache);
-
-  bound.getThumbnailEqualOrSmaller =
-    (preferred, imagePath) =>
-      getThumbnailEqualOrSmaller(preferred, imagePath, thumbsCache);
-
-  return bound;
-}
-
-export function populateSearchIndex(index, descriptor, opts) {
-  const {wikiData} = opts;
-  const bound = bindSearchUtilities(opts);
-
-  for (const thing of descriptor.select(wikiData)) {
-    const reference = thing.constructor.getReference(thing);
-
-    let processed;
-    try {
-      processed = descriptor.process(thing, bound);
-    } catch (caughtError) {
-      throw new Error(
-        `Failed to process searchable thing ${reference}`,
-        {cause: caughtError});
-    }
-
-    index.add({reference, ...processed});
-  }
-}