mirror of
https://gh.wpcy.net/https://github.com/djav1985/v-wordpress-plugin-updater.git
synced 2026-04-28 08:02:16 +08:00
22 lines
513 B
JavaScript
22 lines
513 B
JavaScript
import { DEFAULT_FIX_MODE } from '../constants.mjs';
|
|
|
|
/** @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}
|
|
*/
|
|
export default function normalizeFixMode(fix) {
|
|
if (fix === true || fix === 'true' || fix === '' || fix === DEFAULT_FIX_MODE) {
|
|
return DEFAULT_FIX_MODE;
|
|
}
|
|
|
|
if (fix === 'strict') {
|
|
return 'strict';
|
|
}
|
|
|
|
return undefined;
|
|
}
|