Conformance Examples 0.1.0 — Transforms: transform-sum¶
sum-integers¶
Sums a list of integers; a whole-number total renders without a decimal point.
Template
Context
Output
sum-fractional¶
A non-whole total renders with its fractional part.
Template
Context
Output
sum-numeric-strings¶
Numeric strings are coerced to numbers before summing.
Template
Context
Output
sum-by-property¶
With a property argument, the property of each struct is summed.
Template
Context
Output
sum-empty-list¶
Summing an empty list yields zero.
Template
Context
Output
sum-non-numeric-is-null¶
A non-numeric element means the list does not match the transform's shape, so the result is null.
Template
Context
Output
sum-property-missing-is-null¶
A struct missing the requested property yields a non-numeric value, so the result is null.
Template
Context
Output
sum-property-non-struct-is-null¶
With a property, a non-struct element cannot supply the value, so the result is null.
Template
Context
Output
sum-non-list-is-null¶
sum operates only on lists; a string input yields null.
Template
Context
Output
sum-boolean-element-is-null¶
A boolean element is neither numeric nor a numeric string, so the result is null.
Template
Context
Output
Source fixture: transforms/transform-sum.json