0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 13:38:32 +00:00
renovatebot_renovate/lib/modules/manager/mise/utils.ts
2024-08-19 13:15:27 +00:00

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;
}
}