Class JavaScriptExtractor

java.lang.Object
org.schabi.newpipe.extractor.utils.jsextractor.JavaScriptExtractor

public final class JavaScriptExtractor extends Object
Utility class for extracting functions from JavaScript code.
  • Method Details

    • matchToClosingBrace

      @Nonnull public static String matchToClosingBrace(String jsCode, String start) throws ParsingException
      Searches the given JavaScript code for the identifier of a function and returns its body.
      Parameters:
      jsCode - JavaScript code
      start - start of the function (without the opening brace)
      Returns:
      extracted code (opening brace + function + closing brace)
      Throws:
      ParsingException