How to use the amplify-velocity-template.parse function in amplify-velocity-template

To help you get started, we’ve selected a few amplify-velocity-template examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws-amplify / amplify-cli / packages / amplify-appsync-simulator / src / velocity / index.ts View on Github external
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;


Velocity Template Language(VTL) for JavaScript

Latest version published 3 months ago

Package Health Score

92 / 100
Full package analysis

Popular amplify-velocity-template functions