UNPKG

ajv-json-logic

Version:
62 lines (58 loc) 1.51 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var $schema = "http://json-schema.org/draft-07/schema#"; var $id = "http://jsonlogic.com/schemas/operators/array/reduce.json"; var title = "reduce"; var description = "You can use reduce to combine all the elements in an array into a single value, like adding up a list of numbers. Note, that inside the logic being used to reduce, var operations only have access to an object like: {\n \"current\" : // this element of the array,\n \"accumulator\" : // progress so far, or the initial value\n}"; var type = "object"; var additionalProperties = false; var required = [ "reduce" ]; var properties = { reduce: { $ref: "http://jsonlogic.com/schemas/common/trinary-args.json" } }; var examples = [ { reduce: [ { "var": "integers" }, { "+": [ { "var": "current" }, { "var": "accumulator" } ] }, 0 ] } ]; var arrayReduce = { $schema: $schema, $id: $id, title: title, description: description, type: type, additionalProperties: additionalProperties, required: required, properties: properties, examples: examples }; exports.$id = $id; exports.$schema = $schema; exports.additionalProperties = additionalProperties; exports.default = arrayReduce; exports.description = description; exports.examples = examples; exports.properties = properties; exports.required = required; exports.title = title; exports.type = type; //# sourceMappingURL=reduce.json.cjs.map