Skip to content
Snippets Groups Projects
Unverified Commit 58a6d645 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix(terraform): try/catch HCL parsing (#19792)

parent a0cbd890
No related branches found
No related tags found
No related merge requests found
import * as hcl_parser from 'hcl2-parser'; import * as hcl_parser from 'hcl2-parser';
export function parseHCL(content: string): any { export function parseHCL(content: string): any {
return hcl_parser.parseToObject(content)[0]; try {
return hcl_parser.parseToObject(content)[0];
} catch (err) /* istanbul ignore next */ {
return null;
}
} }
export function parseJSON(content: string): any { export function parseJSON(content: string): any {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment