Skip to main content

Type Alias: EnvironmentOptions

EnvironmentOptions = object

Defined in: src/environment.ts:94

Options for the Environment constructor.

Properties

autoEscape?

optional autoEscape?: boolean

Defined in: src/environment.ts:99

When true, render context variables will be HTML escaped before output.

Default Value

false


globals?

optional globals?: Namespace

Defined in: src/environment.ts:109

An optional object who's properties will be added to the render context of every template rendered from this environment.

globals is not copied, so updates to it after environment construction will be visible to templates.

Default Value

An empty Object.


loader?

optional loader?: TemplateLoader

Defined in: src/environment.ts:116

A template loader. Used to load templates from a file system or database, for example.

Default Value

An empty MapLoader.


maxAssignScore?

optional maxAssignScore?: number

Defined in: src/environment.ts:122

The maximum assign score allowed per template before a resource limit error is thrown.


maxAssignScoreCumulative?

optional maxAssignScoreCumulative?: number

Defined in: src/environment.ts:128

The maximum combined assign score allowed for a template and any rendered partial templates before a resource limit error is thrown.


maxContextDepth?

optional maxContextDepth?: number

Defined in: src/environment.ts:135

The maximum number of times a render context can be copied or extended before throwing a resource limit error.

Default Value

30

maxRenderScore?

optional maxRenderScore?: number

Defined in: src/environment.ts:147

The maximum render score allowed per template before a resource limit error is thrown.


maxRenderScoreCumulative?

optional maxRenderScoreCumulative?: number

Defined in: src/environment.ts:153

The maximum combined render score allowed for a template and any rendered partial templates before a resource limit error is thrown.


maxRenderSize?

optional maxRenderSize?: number

Defined in: src/environment.ts:141

The maximum number of bytes that can be written to an output buffer before a resource limit error is thrown.


strictFilters?

optional strictFilters?: boolean

Defined in: src/environment.ts:161

When true, a NoSuchFilterError will be raised if a template attempts to use an undefined filter. When false, undefined filters are silently ignored.

Default Value

true


undefinedType?

optional undefinedType?: _Undefined

Defined in: src/environment.ts:167

The Undefined type used when a variable or property can not be resolved.

Default Value

Undefined