Type

Muninn can turn data into the desired types during the parsing stage.

Available Types

  • number

  • float

  • boolean

  • array

Array

Array

Number

HTML
<div class="parent">
  <div class="year">1984</div>
</div>
Config
{
    "year": {
        "selector": ".year",
        "type": "number"
    },
}

// or use this shortcut

{
    "year": ".year | number"
}

Float

Boolean

For various reasons, we may want to convert a value to the Boolean type. Let's start with an example we check that the content of the element is empty.

Last updated

Was this helpful?