readdir
Version:
Reads a directory and return results with the ability to use Ant style file match patterns
21 lines • 548 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function sort_paths(paths, sorter) {
return paths.sort(sorter);
}
exports.sort_paths = sort_paths;
exports.caseless_sort = function (pathA, pathB) {
var a = ('' + pathA).toLowerCase();
var b = ('' + pathB).toLowerCase();
if (a == b) {
return 0;
}
return a > b ? 1 : -1;
};
exports.case_sort = function (pathA, pathB) {
if (pathA == pathB) {
return 0;
}
return pathA > pathB ? 1 : -1;
};
//# sourceMappingURL=sort.js.map