mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #7041: Properly format JSON config object returned from a NAPALM device
This commit is contained in:
@ -19,7 +19,9 @@ export function isApiError(data: Record<string, unknown>): data is APIError {
|
||||
return 'error' in data && 'exception' in data;
|
||||
}
|
||||
|
||||
export function hasError(data: Record<string, unknown>): data is ErrorBase {
|
||||
export function hasError<E extends ErrorBase = ErrorBase>(
|
||||
data: Record<string, unknown>,
|
||||
): data is E {
|
||||
return 'error' in data;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user