MCPcopy Index your code
hub / github.com/totaljs/framework / counter_parse_stats

Function counter_parse_stats

nosql.js:3851–3881  ·  view source on GitHub ↗
(matches, opt)

Source from the content-addressed store, hash-verified

3849}
3850
3851function counter_parse_stats(matches, opt) {
3852
3853 var value = null;
3854
3855 for (var i = 0, length = matches.length; i < length; i++) {
3856 var item = matches[i];
3857 var val = item.substring(item.indexOf('=', 3) + 1);
3858
3859 switch (opt.type2 || opt.type) {
3860 case 'max':
3861 var a = counter_minmax(opt, val);
3862 if (value == null)
3863 value = a;
3864 else if (value < a)
3865 value = a;
3866 break;
3867 case 'min':
3868 var a = counter_minmax(opt, val);
3869 if (value == null)
3870 value = a;
3871 else if (value > a)
3872 value = a;
3873 break;
3874 case 'sum':
3875 value += +val;
3876 break;
3877 }
3878 }
3879
3880 return value;
3881}
3882
3883function counter_minmax(opt, val) {
3884 var index = val.indexOf('X');

Callers 1

nosql.jsFile · 0.85

Calls 1

counter_minmaxFunction · 0.85

Tested by

no test coverage detected