0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-02-28 18:44:03 +00:00
renovatebot_renovate/lib/modules/manager/devbox/extract.ts
Sergei Zharinov 19ae54fb09
refactor(devbox): Refactor schema and improve logging (#33978)
Co-authored-by: Will Brennan <will.brennan@cultureamp.com>
Co-authored-by: Will Brennan <will@moondev.co.uk>
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-01-31 21:14:25 +00:00

17 lines
445 B
TypeScript

import { logger, withMeta } from '../../../logger';
import type { PackageFileContent } from '../types';
import { DevboxSchema } from './schema';
export function extractPackageFile(
content: string,
packageFile: string,
): PackageFileContent | null {
logger.trace('devbox.extractPackageFile()');
const deps = withMeta({ packageFile }, () => DevboxSchema.parse(content));
if (!deps.length) {
return null;
}
return { deps };
}