Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update _.object and _.pairs docs to show relation #2583

Merged
merged 3 commits into from
Oct 3, 2016

Conversation

sdwebster
Copy link
Contributor

Long time user, first time contributor. Reading through this well-documented source code, I noticed the link between _.pairs and _.object for the first time. As presented, these 2 related functions are far away from each other (with good reason), so I suggest this highlighting the connection in the annotations. Please let me know if there's a better contribution workflow, if I need to PR first to Underscore-Contrib, etc.

Long time user, first time contributor. Reading through this well-documented source code, I noticed the link between _.pairs and _.object for the first time. As presented, these 2 related functions are far away from each other (with good reason), so I suggest this highlighting the connection in the annotations.
@coveralls
Copy link

coveralls commented Aug 31, 2016

Coverage Status

Coverage remained the same at 96.863% when pulling 7c08ea8 on sdwebster:master into a943227 on jashkenas:master.

@@ -1015,7 +1015,8 @@ <h2 id="arrays">Array Functions</h2>
<b class="header">object</b><code>_.object(list, [values])</code>
<br />
Converts arrays into objects. Pass either a single list of
<tt>[key, value]</tt> pairs, or a list of keys, and a list of values.
<tt>[key, value]</tt> pairs, or a list of keys, and a list of values. The former
usage is invertible through <code>_.pairs</code>.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm on-board with this change, but I'm not sure to what "The former usage" refers. Could you reword?

@@ -1424,7 +1425,8 @@ <h2 id="objects">Object Functions</h2>
<p id="pairs">
<b class="header">pairs</b><code>_.pairs(object)</code>
<br />
Convert an object into a list of <tt>[key, value]</tt> pairs.
Convert an object into a list of <tt>[key, value]</tt> pairs. Inverse of first
usage of <code>_.object</code>.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inverse of first usage of _.object.

In order to better fit with the rest of our documentation, could you reword this as a complete sentence?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @captbaritone , thanks for the feedback. Is this clearer? I tried to match the wording of other "opposites" such as in _.unescape and _.unzip.

Also -- I edited the corresponding comments in underscore.js so that the annotated source will stay consistent w/ the main page. Take a look!

@coveralls
Copy link

coveralls commented Oct 2, 2016

Coverage Status

Coverage remained the same at 96.863% when pulling 7cde4e9 on sdwebster:master into a943227 on jashkenas:master.

@captbaritone captbaritone merged commit 68cc739 into jashkenas:master Oct 3, 2016
@captbaritone
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants