{
  "hidden": true,
  "source": "reduce.js",
  "method": "reduce",
  "input-schema": {
    "type": "object",
    "properties": {
      "collection": {
        "description": "A collection to reduce.",
        "type": "any",
        "required": true
      },
      "key": {
        "type": "string",
        "description": "A variable name for placing the input data on the stack.",
        "default": "item",
        "format": "plain",
        "required": true
      },
      "accumulator":  {
          "type": "flow",
          "title": "flow",
          "required": true,
          "inputtitle": "input",
          "inputkey": "__input",
          "description": "An accumulator sub flow that will be executed for each item in the collection."
      },
      "initial": {
        "type": "any",
        "description": "Initial value"
      }
    }
  },
  "output-schema": {
    "type": "any"
  },
  "meta": {
    "name": "reduce",
    "sort_index": 5,
    "description": "Reduce a collection by applying the provided accumulator sub flow on each element (from left to right) and return a single (reduced) value.",
    "icon": {
      "type": "fa",
      "name": "repeat",
      "color":"#747CA3"
    }
  }
}