class

Analyzer::Javascript::Hapi

Inherits Analyzer < FileHelper < Reference < Object

Constants

HAPI_MARKERS_RE = Regex.union("@hapi/hapi", "require('hapi')", "require(\"hapi\")", "from 'hapi'", "from \"hapi\"")

Precompiled once — a single PCRE2-JIT scan replaces five naive String#includes? substring scans over the whole file content. Regex.union auto-escapes each literal (including the parens in "require('hapi')"), so it is provably equivalent to the OR-of-includes? it replaces.

JS_EXTENSIONS = [".js", ".mjs", ".cjs", ".ts"]

Class methods

tech_name
Source

Instance methods

analyze
Source
tech

Instance-side view of the same declaration. The per-file rescues live on this base class, which has no way to name the analyzer that is running inside them, so a skipped file could not be attributed to a tech. Deriving it from analyzer_for keeps the name written exactly once.

Source