blob: dc222d2814739256ec3e034fcfb32b0294f7bb2c [file] [log] [blame]
// NOTICE: This file is generated by Rollup. To modify it,
// please instead edit the ESM counterpart and rebuild with Rollup (npm run build).
'use strict';
const constants = require('../constants.cjs');
/** @import { FixMode } from 'stylelint' */
/**
* Normalize the fix mode based on options and configuration.
* If the input is unknown, this returns `undefined`.
*
* @param {unknown} fix
* @returns {FixMode | undefined}
*/
function normalizeFixMode(fix) {
if (fix === true || fix === 'true' || fix === '' || fix === constants.DEFAULT_FIX_MODE) {
return constants.DEFAULT_FIX_MODE;
}
if (fix === 'strict') {
return 'strict';
}
return undefined;
}
module.exports = normalizeFixMode;