npm.io
1.0.2 • Published 7 years ago

listformat

Licence
MIT
Version
1.0.2
Deps
0
Size
2 kB
Vulns
0
Weekly
0

ListFormat Ponyfill

This is a simple ponyfill for Intl.ListFormat.

Call it with an Array of strings, and it'll reduce them down to one string in a list format:

import listFormat from 'listFormat'
listFormat(['a', 'b', 'c']) === 'a, b, and c'

If Intl.ListFormat is available on the engine you're running, it'll use that.