Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const rootInfo = getFilePosition(result)
// apply suppression
for (const s of suppressionArray) {
if (s.where !== undefined) {
const paths = it.flatMap(it.isArray(s.where) ? s.where : [s.where], where => {
try {
return jp.paths(result, where)
} catch (e) {
log.error(e)
// TODO: return the error.
return []
}
})
for (const p of paths) {
// drop "$" and apply suppressions.
setSuppression(getDescendantFilePosition(result, it.drop(p)), s)
}
} else {
setSuppression(rootInfo, s)
}
}
return result
}