function prepareJSONataExpression(value,node) {
    var expr = jsonata(value);
    expr.assign('flowContext', function(val, store) {
        if (node) {
            return node.context().flow.get(val, store);
        }
        return "";
    });
    expr.assign('globalContext', function(val, store) {
        if (node) {
            return node.context().global.get(val, store);
        }
        return "";
    });
    expr.assign('env', function(name) {
        var val = getSetting(node, name, node ? node._flow : null);
        if (typeof val !== 'undefined') {
            return val;
        } else {
            return "";
        }
    });
    expr.assign('moment', function(arg1, arg2, arg3, arg4) {
        return moment(arg1, arg2, arg3, arg4);
    });
    expr.registerFunction('clone', cloneMessage, '<(oa)-:o>');
    expr._legacyMode = /(^|[^a-zA-Z0-9_'".])msg([^a-zA-Z0-9_'"]|$)/.test(value);
    expr._node = node;
    return expr;
}
Prepares a JSONata expression for evaluation.
This attaches Node-RED specific functions to the expression.

@param  {String} value - the JSONata expression
@param  {Node}   node  - the node evaluating the property
@return {Object} The JSONata expression that can be evaluated
@memberof @node-red/util_util