Skip to content

Commit 4c3c646

Browse files
committed
Improve comments
1 parent 2ae6869 commit 4c3c646

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/StatusTable.js

+9
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,21 @@ const useStyles = makeStyles({
1717
},
1818
});
1919

20+
// An Array of Arrays
21+
// First element in each array is a regex to match against.
22+
// Second element in the array are the object property keys to
23+
// use to extract the useful parts of an event description from
24+
// event.descriptionArray if we match against the first element regex
2025
const messageDescriptionArray = [
2126
[/^CM-STATUS message sent\. Event Type Code: (?:16|24).*/, ['01','02','05']],
2227
[/^Honoring MDD.*/, ['01','02']],
2328
[/^DS profile assignment change\..*/, ['01','02','03']]
2429
];
2530

31+
// Using first item in event description object, match against the regex in messageDescriptionArray
32+
// If no match, default to first item in event description object as the entire event description
33+
// If a regex match is found, then assemble a full event description from the appropriate elements
34+
// of the event description object.
2635
function matchFromArray(event) {
2736
let foundIndex = messageDescriptionArray.findIndex(element => event.descriptionArray['01'].match(element[0]));
2837
if(foundIndex === -1) {

0 commit comments

Comments
 (0)