Filter request: keys/values
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 11.9k
- Forks
- 1.5k
- Avg merge
- 17h 55m
- Merged PRs (30d)
- 3
Description
One very common need is a way to get all keys or values from a hash; for example, site.data.<folder> in Jekyll returns a hash, where the keys are the base name of the filename, and the values are the contents of the yaml files in the folder.
The filter would look like this:
# Keys of a hash
def keys(input)
input.keys
end
# Values of a hash
def values(input)
input.values
end
You could even provide a shortcut form, hash.values, perhaps? Though just the filter hash | values would be enough for me.
If you are interested, I could help draft a PR with tests and docs.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name specific files, tests, or entry points. Start by locating existing Liquid filter implementations and their tests, then determine where filter documentation belongs; done means the requested hash key and value behavior is covered by tests and documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- web-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100