Skip to main

Utility Filters

src/filters/utils.js


Inspect

typeCheck()

Return either the type, or the result of a type-check.

Params:

  • val {any}

    The data to check

  • is {string} = undefined

    Optionally check for a particular type

Example:

{{ my_data | typeCheck('array') }}

Formatting

styles()

Convert an object of property-value pairs into valid CSS for an inline-style.

Params:

  • dict {object}

    CSS property-value pairs

Example:

<div style="{{ style_dict | styles }}">

See Also: