mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-30 18:12:08 -07:00
20 lines
542 B
TypeScript
20 lines
542 B
TypeScript
import { ConfigValidationWarning } from '../types/config';
|
|
|
|
export interface WarningCollector {
|
|
warnings: ConfigValidationWarning[];
|
|
warn(path: string, value: unknown, fallback: unknown, message: string): void;
|
|
}
|
|
|
|
export function createWarningCollector(): WarningCollector {
|
|
const warnings: ConfigValidationWarning[] = [];
|
|
const warn = (path: string, value: unknown, fallback: unknown, message: string): void => {
|
|
warnings.push({
|
|
path,
|
|
value,
|
|
fallback,
|
|
message,
|
|
});
|
|
};
|
|
return { warnings, warn };
|
|
}
|