Boolean helper
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- tooling
Research direction
Start by reviewing the repository's existing mixin conventions and the proposed isTrue snippet in this issue. Confirm the intended behavior for true, false, undefined, and string values, then check the project tests to determine how the helper's behavior should be verified; completion depends on agreement about adding it.
Written by the indexing model from the issue text.
Description
Pretty frequently I come across the problem of needing to check if an optional variable is true or false. The problem is that the server can send it as true, false, undefined, "true", or "false". I added this mixin (based on this SO answer):
_.mixin({
isTrue: function(str) {
return JSON.parse((str || "false").toLowerCase());
}
});
Thoughts on adding this?
- Dominant language
- JavaScript
- Stars
- 622
- Forks
- 114
- PR merge metrics
- No merged PRs in 30d
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.
More from documentcloud/underscore-contrib
-
breaking change bug
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
documentcloud/underscore-contrib#252 · 7 comments ·
-
after modules enhancement
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
after modules question
Difficulty 5/5 Over a week Newbie friendliness 25/100
documentcloud/underscore-contrib#234 · 1 comment ·
-
after modules docs enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
after modules enhancement
Difficulty 5/5 Over a week Newbie friendliness 32/100
documentcloud/underscore-contrib#225 · 8 comments ·
All issues in documentcloud/underscore-contrib
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
docToolchain/docToolchain#1705 ·
-
Timezone select lists one option per character; duplicate "Failed" reason; shared tracker popover id Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
nightscout/nocturne#1414 ·
-
bug v2
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
modelcontextprotocol/inspector#2458 · 1 comment ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
carbon-design-system/ibm-products#9907 ·