RunKit + npm: filtrex

node v14.20.1
endpointsharetweet
const { compileExpression } = require('filtrex@3.0.0-rc11'); // Input from user (e.g. search filter) const expression = `transactions <= 5 and abs(profit) > 20.5`; // Compile expression to executable function const myfilter = compileExpression(expression); // Execute function a = myfilter({transactions: 3, profit:-40.5}); // returns true b = myfilter({transactions: 3, profit:-14.5}); // returns false console.log(a, b);
Created from: https://npm.runkit.com/filtrex
Loading…