Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: filtrex
node v14.20.1
endpoint
share
tweet
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…
Clone and edit this document