documentcloud / documentcloud/underscore-contrib
Behavior of _.isAssociative and string primitives?
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 622
- Forks
- 114
- PR merge metrics
- No merged PRs in 30d
Description
The comments for _.isAssociative describe an associative object as one which has elements which can be accessed by a key/index. Except for the term "object", string primitives meet this definition. However, _.isAssociative("string") will currently return false.
So it seems like this should be changed in one of two ways:
- Change the name to
isAssociativeObjector... - Return
truefor strings.
I can create a pull request to resolve this, but I'm not sure which way is preferred.
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
Start at the _.isAssociative entry point and read its comments and current behavior for string primitives. This issue needs a maintainer decision between changing the name and returning true for strings; done means the preferred semantics are agreed and the implementation and documentation consistently reflect that choice.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100