muninn
GitHubExtensionWope
  • Introduction
  • Config
    • Basic
    • Selector
    • Array
    • Attribute
    • Type
    • Regex
    • Transform
    • Array Transform
    • Exist
    • Schema
    • Trim
    • Initial
    • Fill
    • HTML
    • Methods
Powered by GitBook
On this page

Was this helpful?

  1. Config

Array Transform

When you want to change an array result while parsing, you can use the arrayTransform method for this.

HTML
<ul>
  <li>orange</li>
  <li>apple</li>
  <li>pineapple</li>
</ul>
Config
{
    "fruits": {
        "selector": "ul li | array",
        "arrayTransform": (arr) => arr.join(', ')
    },
}
Output
{
    "fruits": "orange, apple, pineapple",
}
PreviousTransformNextExist

Last updated 2 years ago

Was this helpful?