mirror of
https://github.com/renovatebot/renovate.git
synced 2025-03-15 08:34:54 +00:00
12 lines
388 B
TypeScript
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), ''));
|
|
}
|