mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-10-24 10:35:14 -05:00
Handle errors loading data in the main window
This commit is contained in:
@@ -19,6 +19,14 @@ export function hrduration(duration: number, short = false) {
|
||||
}
|
||||
}
|
||||
|
||||
export function hrlist(items: string[]) {
|
||||
if (!items.length) throw new Error('list must not be empty');
|
||||
if (items.length === 1) return items[0];
|
||||
|
||||
const last = items[items.length - 1];
|
||||
return items.slice(0, -1).join(', ') + ' and ' + last;
|
||||
}
|
||||
|
||||
export function timeoutSignal(ms = 10 * 1000) {
|
||||
const controller = new AbortController();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user