Skip to content
This repository was archived by the owner on Nov 9, 2023. It is now read-only.

Commit 9b6d392

Browse files
committed
Add warning in docstring
1 parent f1bcf9d commit 9b6d392

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import type {
66
} from './JsonRpcEngine';
77

88
/**
9+
* **ATTN:** Assumes that only one of the `result` and `error` properties are
10+
* present on the `response`, as guaranteed by e.g. `JsonRpcEngine.handle`.
11+
*
912
* Type guard to narrow a JsonRpcResponse object to a success (or failure).
1013
*
1114
* @param response - The response object to check.
@@ -19,6 +22,9 @@ export function isJsonRpcSuccess<T>(
1922
}
2023

2124
/**
25+
* **ATTN:** Assumes that only one of the `result` and `error` properties are
26+
* present on the `response`, as guaranteed by e.g. `JsonRpcEngine.handle`.
27+
*
2228
* Type guard to narrow a JsonRpcResponse object to a failure (or success).
2329
*
2430
* @param response - The response object to check.

0 commit comments

Comments
 (0)