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"); function containsWord(string, word) { return string.includes(word); } let options = { customProp: (word, _, string) => containsWord(string, word) }; let myfilter = compileExpression('Bob and Alice or Cecil', options); a = myfilter("Bob is boring"); // returns 0 b = myfilter("Bob met Alice"); // returns 1 c = myfilter("Cecil is cool"); // returns 1 console.log(a, b, c);
Created from: https://npm.runkit.com/filtrex
Loading…
Clone and edit this document