mirror of
https://github.com/silverstripe/doc.silverstripe.org
synced 2024-09-29 12:49:10 +02:00
10 lines
298 B
TypeScript
10 lines
298 B
TypeScript
|
import { SilverstripeDocument } from "../types";
|
||
|
|
||
|
const sortFiles = (a: SilverstripeDocument, b: SilverstripeDocument): number => {
|
||
|
if (a.isIndex !== b.isIndex) {
|
||
|
return a.isIndex ? -1 : 1;
|
||
|
}
|
||
|
return a.fileAbsolutePath > b.fileAbsolutePath ? 1 : -1;
|
||
|
};
|
||
|
|
||
|
export default sortFiles;
|