import { parse } from '@iarna/toml';
export function getGradleLibsVersionsProperties(libsVersionsContent) {
    const parsed = parse(libsVersionsContent);
    return {
        ...parsed.versions,
        ...Object.fromEntries([
            ...Object.entries(parsed.libraries ?? {}).map(([dependencyName, dependency]) => [
                dependencyName,
                typeof dependency === 'string' ? dependency.split(':')[2] : dependency.version,
            ]),
            ...Object.entries(parsed.plugins ?? {}).map(([dependencyName, dependency]) => [
                dependencyName,
                typeof dependency === 'string' ? dependency.split(':')[1] : dependency.version,
            ]),
        ]),
    };
}
