Type alias TwingEnvironmentOptions

TwingEnvironmentOptions: {
    autoEscapingStrategy?: string;
    autoReload?: boolean;
    cache?: TwingCache;
    charset?: string;
    dateFormat?: string;
    dateIntervalFormat?: string;
    globals?: Record<string, any>;
    numberFormat?: TwingNumberFormat;
    parserOptions?: TwingParserOptions;
    sandboxPolicy?: TwingSandboxSecurityPolicy;
    sandboxed?: boolean;
    strictVariables?: boolean;
    timezone?: string;

Type declaration

  • Optional autoEscapingStrategy?: string

    The implicit auto-escaping strategy to apply to the templates.

    Analogous to adding an autoescape tag at the top of each loaded template.

  • Optional autoReload?: boolean

    Controls whether the templates are recompiled whenever their content changes or not.

    When set to true, templates are recompiled whenever their content changes instead of fetching them from the persistent cache. Note that this won't invalidate the environment inner cache but only the cache passed using the cache option. Defaults to false.

  • Optional cache?: TwingCache

    The persistent cache instance.

  • Optional charset?: string

    The default charset. Defaults to "UTF-8".

  • Optional dateFormat?: string
  • Optional dateIntervalFormat?: string
  • Optional globals?: Record<string, any>
  • Optional numberFormat?: TwingNumberFormat
  • Optional parserOptions?: TwingParserOptions
  • Optional sandboxPolicy?: TwingSandboxSecurityPolicy
  • Optional sandboxed?: boolean
  • Optional strictVariables?: boolean

    Controls whether accessing invalid variables (variables and or attributes/methods that do not exist) triggers a runtime error.

    When set to true, accessing invalid variables triggers a runtime error. When set to false, accessing invalid variables returns null.

    Defaults to false.

  • Optional timezone?: string

Generated using TypeDoc