20 lines
384 B
JavaScript
20 lines
384 B
JavaScript
'use strict';
|
|
|
|
const formatters = require('../formatters');
|
|
|
|
/**
|
|
* @param {{ useOr?: boolean }} [options={}]
|
|
* @returns {string}
|
|
*/
|
|
module.exports = function getFormatterOptionsText(options = {}) {
|
|
let output = Object.keys(formatters)
|
|
.map((name) => `"${name}"`)
|
|
.join(', ');
|
|
|
|
if (options.useOr) {
|
|
output = output.replace(/, ([a-z"]+)$/u, ' or $1');
|
|
}
|
|
|
|
return output;
|
|
};
|