Skip to content

Instantly share code, notes, and snippets.

@displague
Created February 7, 2017 20:00
Show Gist options
  • Save displague/a01d34dbdda3561f0bec70b4da95b33a to your computer and use it in GitHub Desktop.
Save displague/a01d34dbdda3561f0bec70b4da95b33a to your computer and use it in GitHub Desktop.
QuerySome implementation for Adobe CF
<cfscript>
// return true if closure passes for any query row (supplied as a struct)
// based on http://cfdocs.org/querysome available in Lucee
boolean function QuerySome(required query q, required function f) {
for (var r in q) if (f(r)) return true;
return false;
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment