Don't make two API calls for activity log data
This commit is contained in:
parent
986c375052
commit
06427f8d13
4 changed files with 35 additions and 2 deletions
|
@ -65,3 +65,13 @@ export function hashToPath (hash: string): string {
|
|||
export function formatIp (ip: string): string {
|
||||
return /([a-f0-9:]+:+)+[a-f0-9]+/.test(ip) ? `[${ip}]` : ip;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export const isObject = (o: unknown): o is {} => typeof o === 'object' && o !== null;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export const isEmptyObject = (o: {}): boolean =>
|
||||
Object.keys(o).length === 0 && Object.getPrototypeOf(o) === Object.prototype;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export const getObjectKeys = <T extends {}> (o: T): Array<keyof T> => Object.keys(o) as Array<keyof T>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue