Turn an array into a list of comma-separated values, appropriate for use in an English sentence.
by ljharbJavaScript
Last 12 weeks · 0 commits
4 of 6 standards met
Take a look at the lockfile change in https://github.com/whatwg/participate.whatwg.org/pull/104. Going from v1.0.0 to v1.0.1 added the following dependencies to my project: define-properties es-abstract es-to-primitive function-bind has has-symbols is-callable is-date-object is-regex is-symbol object-inspect object-keys object.assign string.prototype.trim string.prototype.trimend string.prototype.trimleft string.prototype.trimright string.prototype.trimstart This isn't really acceptable for a listification package. Would it be possible to revert whatever caused this? The changelog is rather noisy so I can't figure out what it was...
Repository: ljharb/listify. Description: Turn an array into a list of comma-separated values, appropriate for use in an English sentence. Stars: 26, Forks: 4. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v1.0.0 (6y ago). Open PRs: 1, open issues: 0. Last activity: 3y ago. Community health: 85%. Top contributors: ljharb.
When reading your example I noticed that you were inserting a separator after the penultimate element of the array before the lastWord which, in my opinion, isn't appropriate for use in a sentence. I changed it in the following way. Behavior before fix: Behavior after fix: I also added a validation test that asserts two items with finalWord.