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

Add optional conjunction parameter to oxford #79

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add optional conjunction parameter to oxford #79

wants to merge 1 commit into from

Conversation

timothysu
Copy link

A backwards compatible change to the oxford function to support custom conjunctions (rather than it always being 'and'). Also a change to the readme, as npm run install is now npm install.

items = ['apple', 'orange', 'banana', 'pear', 'pineapple']

// Pick a conjunction (defaults to 'and')
Humanize.oxford(items, null, null, "or")
// "apple, orange, banana, pear, or pineapple"

// Also works with a limit
Humanize.oxford(items, 3, null, "with")
// "apple, orange, banana, with 2 others"

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.

1 participant