0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-01-11 13:48:55 +00:00
renovatebot_renovate/lib/modules/manager/cpanfile/extract.ts
2023-11-07 15:50:29 +00:00

16 lines
479 B
TypeScript

import type { PackageFileContent } from '../types';
import { parse } from './parser';
export function extractPackageFile(
content: string,
_packageFile?: string,
): PackageFileContent | null {
const result = parse(content);
if (!result?.deps.length) {
return null;
}
const { deps, perlVersion } = result;
const extractedConstraints = perlVersion ? { perl: perlVersion } : undefined;
return { deps, ...(extractedConstraints && { extractedConstraints }) };
}