mirror of
https://github.com/renovatebot/renovate.git
synced 2025-02-28 18:44:03 +00:00

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>
17 lines
445 B
TypeScript
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 };
|
|
}
|