This repository has been archived on 2020-11-02. You can view files and clone it, but cannot push or open issues or pull requests.
TripSit_Suite/node_modules/stylelint/lib/utils/getFormatterOptionsText.js
2020-11-01 22:46:04 +00:00

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;
};