0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-03-15 08:34:54 +00:00
renovatebot_renovate/lib/util/toml.ts
Sergei Zharinov d2eb48d1a4
fix(poetry): Template keys handling (#34460)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-03-03 17:35:16 +00:00

12 lines
388 B
TypeScript

import { getStaticTOMLValue, parseTOML } from 'toml-eslint-parser';
import { regEx } from './regex';
import { stripTemplates } from './string';
export function parse(input: string): unknown {
const ast = parseTOML(input);
return getStaticTOMLValue(ast);
}
export function massage(input: string): string {
return stripTemplates(input.replace(regEx(/^\s*{{.+?}}\s*=.*$/gm), ''));
}