ajv-json-logic
Version:
JSON Logic integration for Ajv validator
49 lines (47 loc) • 1.26 kB
JavaScript
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
};
export { $id, $schema, additionalProperties, arrayReduce as default, description, examples, properties, required, title, type };
//# sourceMappingURL=reduce.json.js.map