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

RoundingWell / care-ops-frontend / 478f32b5-a05d-4bf1-aab0-cc40366fae9d

17 Sep 2025 08:01AM UTC coverage: 95.256% (-4.7%) from 100.0%
478f32b5-a05d-4bf1-aab0-cc40366fae9d

push

circleci

web-flow
Merge pull request #1514 from RoundingWell/formio-loader

Attach preloader html after formio DOM content is loaded

1709 of 1849 branches covered (92.43%)

Branch coverage included in aggregate %.

6002 of 6246 relevant lines covered (96.09%)

191.66 hits per line

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

36.67
/src/js/utils/sorting.js
1
import { isNumber } from 'underscore';
2

3
// negates based on sort direction a sortable value
4
function sortByDir(sortDirection, sortableVal) {
5
  return (sortDirection === 'desc') ? (sortableVal * -1) : sortableVal;
2,008✔
6
}
7

8
function alphaSort(sortDir, a, b, nullVal = '') {
1,584✔
9
  if (!a) a = nullVal;
2,008✔
10
  if (!b) b = nullVal;
2,008✔
11
  return sortByDir(sortDir, a.localeCompare(b));
2,008✔
12
}
13

14
function getSortNum(val, defaultVal = -1) {
×
15
  return isNumber(val) ? val : defaultVal;
×
16
}
17

18
function numSortBy(sortDir, val, nullVal) {
19
  const num = getSortNum(val, nullVal);
×
20
  return sortByDir(sortDir, num);
×
21
}
22

23
function numSort(sortDir, a, b, nullVal = Number.NEGATIVE_INFINITY) {
×
24
  if (!a) a = nullVal;
×
25
  if (!b) b = nullVal;
×
26
  const sortVal = getSortNum(a, nullVal) > getSortNum(b, nullVal) ? 1 : -1;
×
27
  return sortByDir(sortDir, sortVal);
×
28
}
29

30
function intSortBy(sortDir, val, nullVal) {
31
  const int = getSortNum(val, nullVal);
×
32
  return sortByDir(sortDir, parseInt(int, 10));
×
33
}
34

35
export {
36
  alphaSort,
37
  intSortBy,
38
  numSortBy,
39
  numSort,
40
};
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