fix: resolve some type issues and update tests
This commit is contained in:
parent
e32ee96b73
commit
9e5cde4c2a
2 changed files with 5 additions and 5 deletions
8
fsdb.ts
8
fsdb.ts
|
@ -429,20 +429,20 @@ export class FSDB_COLLECTION<T extends Record<string, any>> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public sorts = {
|
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(
|
((b.info.birthtime ?? b.info.ctime)?.toISOString() ?? '').localeCompare(
|
||||||
(a.info.birthtime ?? a.info.ctime)?.toISOString() ?? ''
|
(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(
|
((a.info.birthtime ?? a.info.ctime)?.toISOString() ?? '').localeCompare(
|
||||||
(b.info.birthtime ?? b.info.ctime)?.toISOString() ?? ''
|
(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() ?? ''),
|
((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() ?? '')
|
((a.info.mtime ?? a.info.ctime)?.toISOString() ?? '').localeCompare((b.info.mtime ?? b.info.ctime)?.toISOString() ?? '')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ const item_collection: fsdb.FSDB_COLLECTION<ITEM> = new fsdb.FSDB_COLLECTION<ITE
|
||||||
});
|
});
|
||||||
|
|
||||||
const items: ITEM[] = [];
|
const items: ITEM[] = [];
|
||||||
const item_count: number = 1_00;
|
const item_count: number = 1_000;
|
||||||
const midpoint: number = Math.floor(item_count / 2);
|
const midpoint: number = Math.floor(item_count / 2);
|
||||||
let first_id = null;
|
let first_id = null;
|
||||||
let time_mid = null;
|
let time_mid = null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue