From 9b8e343e1b9b5b13a30fb916bfc0d642e99fccc8 Mon Sep 17 00:00:00 2001 From: Ryland Herrick Date: Wed, 10 Feb 2021 15:59:50 -0600 Subject: [PATCH] Explicitly type our enriched signals These are being typed implicitly and verified against SignalSourceHit[] on the assignment below, but this makes the types explicit and surfaces a type error here instead of the subsequent assignment. --- .../signals/threat_mapping/enrich_signal_threat_matches.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/enrich_signal_threat_matches.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/enrich_signal_threat_matches.ts index 8a292f92480faa..c298ef98ebcd53 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/enrich_signal_threat_matches.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/threat_mapping/enrich_signal_threat_matches.ts @@ -82,7 +82,7 @@ export const enrichSignalThreatMatches = async ( buildMatchedIndicator({ queries, threats: matchedThreats }) ); - const enrichedSignals = uniqueHits.map((signalHit, i) => { + const enrichedSignals: SignalSourceHit[] = uniqueHits.map((signalHit, i) => { const threat = get(signalHit._source, 'threat') ?? {}; if (!isObject(threat)) { throw new Error(`Expected threat field to be an object, but found: ${threat}`);