mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-02 10:33:39 +00:00
848ef4a88e
feat: support TOML 1.1
13 lines
418 B
TypeScript
13 lines
418 B
TypeScript
import { getStaticTOMLValue, parseTOML } from 'toml-eslint-parser';
|
|
import { regEx } from './regex.ts';
|
|
import { stripTemplates } from './string.ts';
|
|
|
|
export function parse(input: string): unknown {
|
|
const ast = parseTOML(input, { tomlVersion: '1.1' });
|
|
return getStaticTOMLValue(ast);
|
|
}
|
|
|
|
export function massage(input: string): string {
|
|
return stripTemplates(input.replace(regEx(/^\s*{{.+?}}\s*=.*$/gm), ''));
|
|
}
|