Treatment process



⬡ engine: javascript::JavaScriptEngine


↳ var code: string = ""


⇥ value: Stream<string>


↦ is_valid: Stream<bool>
↦ result: Stream<string>

Executes JavaScript code on values.

For every incoming value, code is executed as-is within engine. Inside the code part the incoming value is reffered as globally-accessible value variable. value must be valid JSON data, in order to be turned into proper JS object. code can return any JS object convertible into JSON data.

If value is not proper JSON data, code not actually processable JavaScript code, or its return value not convertible into JSON, an empty result and is_valid false value are send. In all other cases, result contains JSON string and is_valid is true.