Skip to content

Commit

Permalink
Add a note for future devs
Browse files Browse the repository at this point in the history
If/when that constant changes, I imagine this will be useful context.
  • Loading branch information
rylnd committed Feb 24, 2021
1 parent 40c280b commit 4790415
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ export const enrichSignalThreatMatches = async (
if (!isObject(threat)) {
throw new Error(`Expected threat field to be an object, but found: ${threat}`);
}
// We are not using INDICATOR_DESTINATION_PATH here because the code above
// and below make assumptions about its current value, 'threat.indicator',
// and making this code dynamic on an arbitrary path would introduce several
// new issues.
const existingIndicatorValue = get(signalHit._source, 'threat.indicator') ?? [];
const existingIndicators = [existingIndicatorValue].flat(); // ensure indicators is an array

Expand Down

0 comments on commit 4790415

Please sign in to comment.