fix: resolve some type issues and update tests

This commit is contained in:
Andy Burke 2025-07-02 19:02:54 -07:00
parent e32ee96b73
commit 9e5cde4c2a
2 changed files with 5 additions and 5 deletions

View file

@ -429,20 +429,20 @@ export class FSDB_COLLECTION<T extends Record<string, any>> {
}
public sorts = {
newest: (a: WALK_ENTRY<T>, b: WALK_ENTRY<T>) =>
newest: (a: WALK_ENTRY<T>, b: WALK_ENTRY<T>): number =>
((b.info.birthtime ?? b.info.ctime)?.toISOString() ?? '').localeCompare(
(a.info.birthtime ?? a.info.ctime)?.toISOString() ?? ''
),
oldest: (a: WALK_ENTRY<T>, b: WALK_ENTRY<T>) =>
oldest: (a: WALK_ENTRY<T>, b: WALK_ENTRY<T>): number =>
((a.info.birthtime ?? a.info.ctime)?.toISOString() ?? '').localeCompare(
(b.info.birthtime ?? b.info.ctime)?.toISOString() ?? ''
),
latest: (a: WALK_ENTRY<T>, b: WALK_ENTRY<T>) =>
latest: (a: WALK_ENTRY<T>, b: WALK_ENTRY<T>): number =>
((b.info.mtime ?? b.info.ctime)?.toISOString() ?? '').localeCompare((a.info.mtime ?? a.info.ctime)?.toISOString() ?? ''),
stalest: (a: WALK_ENTRY<T>, b: WALK_ENTRY<T>) =>
stalest: (a: WALK_ENTRY<T>, b: WALK_ENTRY<T>): number =>
((a.info.mtime ?? a.info.ctime)?.toISOString() ?? '').localeCompare((b.info.mtime ?? b.info.ctime)?.toISOString() ?? '')
};
}

View file

@ -17,7 +17,7 @@ const item_collection: fsdb.FSDB_COLLECTION<ITEM> = new fsdb.FSDB_COLLECTION<ITE
});
const items: ITEM[] = [];
const item_count: number = 1_00;
const item_count: number = 1_000;
const midpoint: number = Math.floor(item_count / 2);
let first_id = null;
let time_mid = null;