You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
384 B
19 lines
384 B
'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; |
|
};
|
|
|