zspecza / common-tags

🔖 Useful template literal tags for dealing with strings in ES2015+

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix inconsistency in README: Code example for inlineArray uses Serial Comma, actual output is Non-Serial

johnlindquist opened this issue · comments

https://github.com/declandewet/common-tags#commalistsand

^ shows the output
I like apples, bananas, and watermelons

Actual output
I like apples, bananas and watermelons

I'm not sure which you're intending to be the correct behavior.

Related:
If you do support Oxford comma, then you need to support:

"Foo and bar"
The current inline transformer with separator and conjunction options looks like it would only handle:
"Foo, and bar" with a comma.

@johnlindquist Nice spot! This is a typo. The actual output is correct. The conjunction set by the underlying InlineArrayTransformer is supposed to replace the last comma.