mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-01 10:09:50 +00:00
930cf6633c
fix: Additional vi.mock path corrections and prettier formatting
18 lines
413 B
TypeScript
18 lines
413 B
TypeScript
import { parse } from '@cdktf/hcl2json';
|
|
import type { TerraformDefinitionFile } from './types.ts';
|
|
|
|
export async function parseHCL(
|
|
content: string,
|
|
fileName: string,
|
|
): Promise<TerraformDefinitionFile | null> {
|
|
try {
|
|
return await parse(fileName, content);
|
|
} catch {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
export function parseJSON(content: string): TerraformDefinitionFile | null {
|
|
return JSON.parse(content);
|
|
}
|