mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-18 20:15:38 +00:00
29 lines
706 B
JavaScript
29 lines
706 B
JavaScript
// 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;
|