docs: def to_javascript_data(plugins):
      """
      Return a dictionary with all JavaScript matchers. Quotes are escaped.
  
      :rtype: dict
  
      """
  
      def escape(v):
          return re.sub(r'"', r'\\"', v)
  
      def dom_matchers(p):
          dom_matchers = p.get_matchers('dom')
          escaped_dom_matchers = []
  
          for dm in dom_matchers:
              check_statement, version_statement = dm
  
              escaped_dom_matchers.append({
                  'check_statement': escape(check_statement),
                  # Escape '' and not None
                  'version_statement': escape(version_statement or ''),
              })
  
          return escaped_dom_matchers
  
      return [{'name': p.name, 'matchers': dom_matchers(p)}
              for p in plugins.with_dom_matchers()]