Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(template: AppSyncVTLTemplate, private simulatorContext: AmplifyAppSyncSimulator) {
try {
const ast = parse(template.content.toString());
this.compiler = new Compile(ast, {
valueMapper: map,
escape: false,
});
this.template = template;
} catch (e) {
const lineDetails = `${e.hash.line}:${e.hash.loc.first_column}`;
const fileName = template.path ? `${template.path}:${lineDetails}` : lineDetails;
const templateError = new VelocityTemplateParseError(`Error:Parse error on ${fileName} \n${e.message}`);
templateError.stack = e.stack;
throw templateError;
}
}
render(