Created
June 29, 2022 09:37
-
-
Save trycf/e38ea3075468fca05b1ad58f4c31810f to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
NonZeroCounts = StructReduce(TheJSON.data.counts, function(result, key, value) { | |
if (value > 0) { | |
result['data'][key] = value; | |
if (result['data'][key] DOES NOT CONTAIN "warning" && result['data'][key] DOES NOT CONTAIN "error") { | |
result['tcount'] += value; | |
} | |
} | |
return result; | |
}, {data:{},tcount: 0}) ; | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment