1 | import { factory } from '../../utils/factory.js';
|
2 | import { errorTransform } from './utils/errorTransform.js';
|
3 | import { createSum } from '../../function/statistics/sum.js';
|
4 | import { lastDimToZeroBase } from './utils/lastDimToZeroBase.js';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | var name = 'sum';
|
14 | var dependencies = ['typed', 'config', 'add', 'numeric'];
|
15 | export var createSumTransform = factory(name, dependencies, _ref => {
|
16 | var {
|
17 | typed,
|
18 | config,
|
19 | add,
|
20 | numeric
|
21 | } = _ref;
|
22 | var sum = createSum({
|
23 | typed,
|
24 | config,
|
25 | add,
|
26 | numeric
|
27 | });
|
28 | return typed(name, {
|
29 | '...any': function any(args) {
|
30 | args = lastDimToZeroBase(args);
|
31 |
|
32 | try {
|
33 | return sum.apply(null, args);
|
34 | } catch (err) {
|
35 | throw errorTransform(err);
|
36 | }
|
37 | }
|
38 | });
|
39 | }, {
|
40 | isTransformFunction: true
|
41 | }); |
\ | No newline at end of file |