Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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);