How to use filtrex - 1 common examples

To help you get started, we’ve selected a few filtrex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github piximi / application / src / pages / images / ImageSearch / ImageSearch.tsx View on Github external
export const ImageSearch = (searchInput: string) => {
  try {
    var searchFunction = compileExpression(searchInput);
  } catch (error) {
    alert('invalid search input');
    return true;
  }

  const negativeSearchResults: string[] = [];
  const positiveSearchResults: string[] = [];
  flattendedImages.forEach(image => {
    if (searchFunction(image) === 0) {
      negativeSearchResults.push(image.identifier);
    } else {
      positiveSearchResults.push(image.identifier);
    }
  });

  changeImagesVisibilityFunction(negativeSearchResults, false);

filtrex

A simple, safe, JavaScript Filter Expression compiler for end-users

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis

Popular filtrex functions

Similar packages