@mintlify/prebuild
Version:
Helpful functions for Mintlify's prebuild step
15 lines (14 loc) • 456 B
JavaScript
import chalk from 'chalk';
let warnings = [];
export const clearWarnings = () => {
warnings = [];
};
export const addWarning = (warning) => {
warnings.push(warning);
console.log(chalk.yellow.bold('warning') + ' - ' + warning.message);
};
export const checkStrictMode = (strict) => {
if (strict && warnings.length > 0) {
throw new Error(`Build validation failed with ${warnings.length} warning(s). See above for details.`);
}
};