def js_to_url_function(converter):
    if hasattr(converter, 'js_to_url_function'):
        data = converter.js_to_url_function()
    else:
        for cls in getmro(type(converter)):
            if cls in js_to_url_functions:
                data = js_to_url_functions[cls](converter)
                break
        else:
            return 'encodeURIComponent'
    return '(function(value) { %s })' % data
Get the JavaScript converter function from a rule.
dataset/ETHPy150Open IanLewis/kay/kay/lib/werkzeug/contrib/jsrouting.py/js_to_url_function