Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
658 B
0
Indexable
Never
// Checking the offenses individually 
async function filterOffenses(data) {
    const filtered_offenses = [];
    let filtered_offenses_count = 0;

    for (const item of data) {
        if (item.description.trim() !== "Log resets/error conditions/failures/threshold exceptions Detected") {

            
            //Add filtered data to a new object
            filtered_offenses.push(item);

            //Count the offenses
            filtered_offenses_count++;
        }
    }

    //Return the filtered data and offenses count
    return { filtered_offenses, filtered_offenses_count };
}


module.exports = { filterOffenses }
Leave a Comment