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

Fdawgs / ydh-myydh-crud-api / 4417510579

pending completion
4417510579

push

github

GitHub
chore(main): release 11.0.7 (#1221)

259 of 259 branches covered (100.0%)

Branch coverage included in aggregate %.

527 of 527 relevant lines covered (100.0%)

14.21 hits per line

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

100.0
/src/plugins/convert-date-param-operator/index.js
1
const fp = require("fastify-plugin");
4✔
2

3
/**
4
 * @author Frazer Smith
5
 * @author NextGen Healthcare
6
 * @param {string} operator - Date param operator, in any letter case.
7
 * @description Convert date param operator to corresponding value.
8
 * @returns {string} converted date param operator.
9
 */
10
function convDateParamOperator(operator) {
11
        switch (operator.toLowerCase()) {
48✔
12
                case "ap":
13
                        return "=";
1✔
14
                case "eb":
15
                        return "<";
1✔
16
                case "eq":
17
                        return "=";
1✔
18
                case "ge":
19
                        return ">=";
9✔
20
                case "gt":
21
                        return ">";
1✔
22
                case "le":
23
                        return "<=";
1✔
24
                case "lt":
25
                        return "<";
1✔
26
                case "ne":
27
                        return "!=";
1✔
28
                case "sa":
29
                        return ">";
1✔
30
                default:
31
                        return "=";
31✔
32
        }
33
}
34

35
/**
36
 * @author Frazer Smith
37
 * @description Plugin that decorates Fastify instance with `convertDateParamOperator` function,
38
 * which convert date param operators to corresponding values.
39
 * @param {object} server - Fastify instance.
40
 */
41
async function plugin(server) {
42
        server.decorate("convertDateParamOperator", convDateParamOperator);
24✔
43
}
44

45
module.exports = fp(plugin, {
4✔
46
        fastify: "4.x",
47
        name: "convert-date-param-operator",
48
});
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

© 2025 Coveralls, Inc