On this page
Overview
Matches configured risk signals and levels against complete text.
- Artifact
RiskSignalAnalyzer.js· esm - Classification
public first party - Availability
Cross-host - Normalization
Complete literal text; existing non-string conversion only.
Import and lifecycle
import * as module from '/node_modules/arcane-os/runtime/arcane/modules/RiskSignalAnalyzer.js';
Scans String(input ?? "") without Unicode normalization or whitespace changes; resets each supplied RegExp lastIndex before testing and does not mutate the input.
Application-facing behavior: DEFAULTLEVELS, analyzeRiskSignals().
Protocol and host implementation
In-process only This detail does not widen the application-facing API or grant authority.
Exports, signatures, parameters, and results
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
analyzeRiskSignals | function | function analyzeRiskSignals(input,{signals=[],levels=DEFAULT_LEVELS}={}) | input,{signals=[],levels=DEFAULT_LEVELS}={} |
DEFAULT_LEVELS | variable · value | variable DEFAULT_LEVELS | — |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
analyzeRiskSignals | exported-function | function analyzeRiskSignals(input,{signals=[],levels=DEFAULT_LEVELS}={}) | input,{signals=[],levels=DEFAULT_LEVELS}={} |
Parameter meanings and results
DEFAULT_LEVELS; analyzeRiskSignals(input,{signals:[{id,pattern,weight,label?,guidance?}],levels?}) returns mutable {level,matches,score,textLength} for the complete input. textLength is the unchanged JavaScript string length after existing non-string conversion; null and undefined become an empty string.
Events, side effects, and errors
Source-literal CustomEvent dispatches
No source-literal CustomEvent dispatch is part of this artifact.
Lifecycle and event flow
This artifact has no additional documented lifecycle event flow.
Direct coded failures
This artifact directly assigns no stable coded failure.
Exported Error subclasses
This artifact exports no Error subclass.
Documented failure behavior
- Normally none; malformed custom iterables/levels can produce standard JavaScript errors.
Availability and capabilities
Cross-host. Complete literal text; existing non-string conversion only.
None.
Contract example
import {analyzeRiskSignals} from '/node_modules/arcane-os/runtime/arcane/modules/RiskSignalAnalyzer.js';
console.log(analyzeRiskSignals('Send a gift card now.', {
signals:[{id:'gift-card',pattern:/gift card/i,weight:40}]
}));
Related reference
No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.