RunKit + npm: filtrex

node v14.20.1
endpointsharetweet
const { compileExpression } = require("filtrex@3.0.0-rc11"); // Custom function: Return string length. function strlen(s) { return s.length; } let options = { extraFunctions: { strlen } }; // Compile expression to executable function let myfilter = compileExpression('strlen(firstname) > 5', options); a = myfilter({firstname:'Joe'}); // → 0 b = myfilter({firstname:'Joseph'}); // → 1 console.log(a, b);
Created from: https://npm.runkit.com/filtrex
Loading…