import { logger } from "../../../logger/index.js";
import { GitTagsDatasource } from "../../datasource/git-tags/index.js";
import { CopierAnswersFile } from "./schema.js";

//#region lib/modules/manager/copier/extract.ts
function extractPackageFile(content, packageFile) {
	let parsed;
	try {
		parsed = CopierAnswersFile.parse(content);
	} catch (err) {
		logger.debug({
			err,
			packageFile
		}, `Parsing Copier answers YAML failed`);
		return null;
	}
	return { deps: [{
		datasource: GitTagsDatasource.id,
		depName: parsed._src_path,
		packageName: parsed._src_path,
		depType: "template",
		currentValue: parsed._commit
	}] };
}

//#endregion
export { extractPackageFile };
//# sourceMappingURL=extract.js.map