Analyzer::Javascript::Koa
Inherits Analyzer::Javascript::JavascriptEngine < Analyzer < FileHelper < Reference < Object
Constants
KOA_BARE_ARG_RE = /\A(\w+)\z/
KOA_CTOR_PREFIX_RE = /(\w+)\s*=\s*new\s+\w*Router\s*\(\s*\{[^}]*?\bprefix\s*:\s*['"]([^'"]+)['"]/
const api = new Router({ prefix: '/api' })
KOA_DEFAULT_REEXPORT_RE = /\bexport\s*\{\s*default(?:\s+as\s+default)?\s*\}\s*from\s*['"]([^'"]+)['"]|\bmodule\.exports\s*=\s*require\s*\(\s*['"]([^'"]+)['"]\s*\)/
A barrel that forwards its default: export { default } from './x',
module.exports = require('./x').
KOA_FACTORY_CALL_RE = /\b(?:const|let|var)\s+(\w+)\s*=\s*(?:await\s+)?(\w+)\s*\(/
KOA_MOUNT_ARG_RE = /\A\w*[mM]ount\s*\(\s*(?:['"]([^'"]*)['"]\s*,\s*)?(\w+)\s*\)\z/
koa-mount: app.use(mount('/api', api)), app.use(mount(routes)).
KOA_PREFIX_ARG_RE = /\A['"]([^'"]+)['"]\z/
KOA_ROUTES_ARG_RE = /\A(\w+)\.routes\s*\(\s*\)\z/
KOA_USE_CALL_RE = /(\w+)\.use\s*\(/
MAX_KOA_REEXPORT_DEPTH = 5
Class methods
tech_name
SourceInstance methods
analyze
Sourcetech
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.