esbuild-plugin-filesize
Version:
ESBuild plugin for displaying filesize.
15 lines (14 loc) • 947 B
JavaScript
export function normalizeOption({ showMinifiedSize, showGzippedSize, showBrotliSize, showPluginTitle, format,
// exclude,
theme, }) {
const normalizedOption = {
showMinifiedSize: showMinifiedSize !== null && showMinifiedSize !== void 0 ? showMinifiedSize : true,
showGzippedSize: showGzippedSize !== null && showGzippedSize !== void 0 ? showGzippedSize : true,
showBrotliSize: showBrotliSize !== null && showBrotliSize !== void 0 ? showBrotliSize : true,
showPluginTitle: showPluginTitle !== null && showPluginTitle !== void 0 ? showPluginTitle : true,
theme: theme !== null && theme !== void 0 ? theme : 'dark',
format: Object.assign({ base: 2, bits: false, output: 'string', round: 2, separator: '.', spacer: ' ' }, (format !== null && format !== void 0 ? format : {})),
// exclude: exclude ? (Array.isArray(exclude) ? exclude : [exclude]) : [],
};
return normalizedOption;
}