MCPcopy Create free account
hub / github.com/totaljs/framework / counter_parse_months_all

Function counter_parse_months_all

nosql.js:4032–4060  ·  view source on GitHub ↗
(output, value, year, opt)

Source from the content-addressed store, hash-verified

4030}
4031
4032function counter_parse_months_all(output, value, year, opt) {
4033 var arr = value.trim().split(';');
4034
4035 for (var i = 1, length = arr.length; i < length; i++) {
4036 var val = arr[i].substring(5);
4037 var key = year + arr[i].substring(0, 2);
4038
4039 if (!output[key]) {
4040 output[key] = opt.type2 ? counter_minmax(opt, val) : +val;
4041 continue;
4042 }
4043
4044 switch (opt.type2 || opt.type) {
4045 case 'max':
4046 var a = counter_minmax(opt, val);
4047 if (output[year] < a)
4048 output[year] = a;
4049 break;
4050 case 'min':
4051 var a = counter_minmax(opt, val);
4052 if (output[year] > a)
4053 output[year] = a;
4054 break;
4055 case 'sum':
4056 output[key] += +val;
4057 break;
4058 }
4059 }
4060}
4061
4062function counter_parse_days_all(output, value, year, opt) {
4063 var arr = value.trim().split(';');

Callers 1

nosql.jsFile · 0.85

Calls 1

counter_minmaxFunction · 0.85

Tested by

no test coverage detected