next
Version:
The React Framework
11 lines (10 loc) • 362 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getOxfordCommaList = getOxfordCommaList;
function getOxfordCommaList(items) {
return items.map((v, index, { length })=>(index > 0 ? index === length - 1 ? length > 2 ? ', and ' : ' and ' : ', ' : '') + v
).join('');
}
//# sourceMappingURL=oxford-comma-list.js.map
;