UNPKG

384 BJavaScriptView Raw
1'use strict';
2
3const formatters = require('../formatters');
4
5/**
6 * @param {{ useOr?: boolean }} [options={}]
7 * @returns {string}
8 */
9module.exports = function getFormatterOptionsText(options = {}) {
10 let output = Object.keys(formatters)
11 .map((name) => `"${name}"`)
12 .join(', ');
13
14 if (options.useOr) {
15 output = output.replace(/, ([a-z"]+)$/u, ' or $1');
16 }
17
18 return output;
19};