0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-05-15 00:42:26 +00:00
renovatebot_renovate/lib/modules/manager/terraform/hcl/index.ts
renovate[bot] eb8c08079e
chore(deps): update typescript-eslint monorepo to v8 (major) (#30750)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-08-14 10:33:02 +00:00

17 lines
437 B
TypeScript

import { parse } from '@cdktf/hcl2json';
import type { TerraformDefinitionFile } from './types';
export async function parseHCL(
content: string,
fileName: string,
): Promise<TerraformDefinitionFile | null> {
try {
return await parse(fileName, content);
} catch /* istanbul ignore next */ {
return null;
}
}
export function parseJSON(content: string): TerraformDefinitionFile | null {
return JSON.parse(content);
}