mirror of
https://github.com/renovatebot/renovate.git
synced 2024-12-22 13:38:32 +00:00
17 lines
446 B
TypeScript
17 lines
446 B
TypeScript
import { logger } from '../../../logger';
|
|
import type { MiseFileSchema } from './schema';
|
|
import { MiseFileSchemaToml } from './schema';
|
|
|
|
export function parseTomlFile(
|
|
content: string,
|
|
packageFile: string,
|
|
): MiseFileSchema | null {
|
|
const res = MiseFileSchemaToml.safeParse(content);
|
|
if (res.success) {
|
|
return res.data;
|
|
} else {
|
|
logger.debug({ err: res.error, packageFile }, 'Error parsing Mise file.');
|
|
return null;
|
|
}
|
|
}
|