oxford-comma-list.js 357 B

12345678910
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.getOxfordCommaList = getOxfordCommaList;
  6. function getOxfordCommaList(items) {
  7. return items.map((v, index, { length })=>(index > 0 ? index === length - 1 ? length > 2 ? ", and " : " and " : ", " : "") + v).join("");
  8. }
  9. //# sourceMappingURL=oxford-comma-list.js.map