UNPKG

env-sentinel

Version:

Zero-dependency tool that auto-validates .env files against schema.env, with optional fallback and secure warnings.

23 lines (22 loc) 738 B
import { log } from './log.js'; import { ErrorFormatter } from './error-formatter.js'; export function formatIssues(issues, filePath) { issues.forEach((issue) => { const formattedMessage = ErrorFormatter.formatIssue(issue, { filePath, lineNumber: issue.line }); switch (issue.severity || 'error') { case 'notice': log.notice(formattedMessage); break; case 'warning': log.warn(formattedMessage); break; case 'error': default: log.error(formattedMessage); break; } }); } export function printResult(result, filePath) { formatIssues(result.issues, filePath); }