UNPKG

mongoose-management

Version:
19 lines (18 loc) 501 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.sortByName = (a, b) => { const pathA = a.getName().toLowerCase(); const pathB = b.getName().toLowerCase(); if (pathA === pathB) { return 0; } return pathA < pathB ? -1 : 1; }; exports.sortByPath = (a, b) => { const pathA = a.getPath().toLowerCase(); const pathB = b.getPath().toLowerCase(); if (pathA === pathB) { return 0; } return pathA < pathB ? -1 : 1; };