code: 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
docs: Get the JavaScript converter function from a rule.