MCPcopy Create free account
hub / github.com/flatlogic/react-material-admin / compareValues

Function compareValues

src/repositories/usersMockRepository.js:244–255  ·  view source on GitHub ↗
(left, right)

Source from the content-addressed store, hash-verified

242}
243
244function compareValues(left, right) {
245 const leftComparable = toComparableValue(left);
246 const rightComparable = toComparableValue(right);
247
248 if (leftComparable < rightComparable) {
249 return -1;
250 }
251 if (leftComparable > rightComparable) {
252 return 1;
253 }
254 return 0;
255}
256
257function normalizeRole(role) {
258 return role === 'admin' ? 'admin' : 'user';

Callers 1

applySortingFunction · 0.85

Calls 1

toComparableValueFunction · 0.85

Tested by

no test coverage detected