Function: detectThreatPatterns()
detectThreatPatterns(Defined in: validators.ts:456 Run every enabled detector againstinput,config?):ThreatDetectionResult
input and aggregate findings.
Returns early-but-not-immediately: each individual detector still
runs to completion, but each detector returns at most one finding,
so the aggregate threats array is small (≤ 6 entries).
Non-string inputs (null, undefined, numbers, …) are treated as
safe — wrap caller-side validation around this if you want to
reject non-strings.
Parameters
input
string
The candidate string.
config?
ThreatDetectionConfig = DEFAULT_CONFIG
Detector toggles. Defaults turn on everything
except command-injection.
Returns
ThreatDetectionResult
{ isSafe, threats }.