Skip to main content

Type Alias: TemplateAnalysis

TemplateAnalysis: object

The result of statically analyzing a template's variables.

Each of the following properties is an object mapping template variable names to an array of objects. Each object includes the template name and line number of the associated variable. If a name is referenced multiple times, it will appear multiple times in the array. If a name is referenced before it is "assigned", it will appear in localVariables and globalVariables.

Type declaration

failedVisits

failedVisits: VariableRefs

Names and locations of AST Node and Expression objects that could not be visited, probably because they do not implement a children method.

filters

filters: VariableRefs

Filters found during static analysis.

globalVariables

globalVariables: VariableRefs

Template variables that, on the given line number and "file", are out of scope or are assumed to be "global". That is, expected to be included by the application developer rather than a template author.

localVariables

localVariables: VariableRefs

Template variables that are added to the template local scope, whether they are subsequently used or not.

tags

tags: VariableRefs

Tags found during static analysis.

unloadablePartials

unloadablePartials: VariableRefs

Names/identifiers and locations of partial templates that could not be loaded. This will be empty if followPartials is false.

variables

variables: VariableRefs

All referenced variables, whether they are in scope or not. Including references to names such as forloop from the for tag.

Defined in

src/static_analysis.ts:88