Is there a way to use map() in a conditional manner ?
My problem is that I am using jq against Github repos.
Some repos (e.g. https://api.github.com/repos/containerd/nerdctl/releases) use prerelease flag and therefore I can use map(select(.prerelease==false))|first
Other repos (e.g. https://api.github.com/repos/slsa-framework/slsa-verifier/releases) do not and therefore map(select(.prerelease==false)) has no effect.
Therefore I need a way to conditionally check for the existence of .prerelease and if present apply map().