15 lines
390 B
JavaScript
15 lines
390 B
JavaScript
//@ts-check
|
|
|
|
/**
|
|
* @typedef {import("./parseFileList.mjs").ParsedLine} ParsedLine
|
|
*/
|
|
|
|
/**
|
|
* Sorts a list of parsed lines by a given property in-place
|
|
* @param {ParsedLine[]} lines
|
|
* @param {keyof ParsedLine} property
|
|
*/
|
|
export const sortFileListLines = (lines, property = 'date_unix') =>
|
|
lines.sort(({ [property]: a }, { [property]: b }) => a - b);
|
|
|
|
export default sortFileListLines |