• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PayU / prometheus-api-metrics / 5049301469

pending completion
5049301469

push

github

snyk-bot
fix: upgrade @types/koa from 2.13.4 to 2.13.6

108 of 151 branches covered (71.52%)

Branch coverage included in aggregate %.

187 of 237 relevant lines covered (78.9%)

18.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.33
/src/utils.js
1
'use strict';
2

3
const getMetricNames = (metricNames, useUniqueHistogramName, metricsPrefix, projectName) => {
1✔
4
    const prefix = useUniqueHistogramName === true ? projectName : metricsPrefix;
8✔
5

6
    if (prefix) {
8✔
7
        Object.keys(metricNames).forEach(key => {
4✔
8
            metricNames[key] = `${prefix}_${metricNames[key]}`;
20✔
9
        });
10
    }
11

12
    return metricNames;
8✔
13
};
14

15
const isArray = (input) => Array.isArray(input);
10✔
16

17
const isFunction = (input) => typeof input === 'function';
1✔
18

19
const isString = (input) => typeof input === 'string';
1✔
20

21
const shouldLogMetrics = (excludeRoutes, route) => excludeRoutes.every((path) => !route.includes(path));
100✔
22

23
const validateInput = ({ input, isValidInputFn, defaultValue, errorMessage }) => {
1✔
24
    if (typeof input !== 'undefined') {
32✔
25
        if (isValidInputFn(input)) {
10!
26
            return input;
10✔
27
        } else {
28
            throw new Error(errorMessage);
×
29
        }
30
    }
31

32
    return defaultValue;
22✔
33
};
34

35
module.exports.getMetricNames = getMetricNames;
1✔
36
module.exports.isArray = isArray;
1✔
37
module.exports.isFunction = isFunction;
1✔
38
module.exports.isString = isString;
1✔
39
module.exports.shouldLogMetrics = shouldLogMetrics;
1✔
40
module.exports.validateInput = validateInput;
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc