open-policy-agent / opa

Open Policy Agent (OPA) is an open source, general-purpose policy engine.
https://www.openpolicyagent.org
Apache License 2.0
9.32k stars 1.29k forks source link

Implement a built-in function for String count #6841

Closed Manish-Giri closed 2 days ago

Manish-Giri commented 2 days ago

Fixes #6827

Why the changes in this PR are needed?

These changes would be an enhancement over first having to generate the indices, then again a count of the indices.

What are the changes in this PR?

Adding support for a strings.Count built-in function, that would return the count of occurrences directly. Includes tests.

netlify[bot] commented 2 days ago

Deploy Preview for openpolicyagent ready!

Name Link
Latest commit de6a8dd010c7f6d1c26db55b0218586b3ec2fa3b
Latest deploy log https://app.netlify.com/sites/openpolicyagent/deploys/66857e7f21c34200080b6273
Deploy Preview https://deploy-preview-6841--openpolicyagent.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Manish-Giri commented 2 days ago

Looks like there is a Yml lint issue, should I submit the fix quickly?