You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The assumption here is that the id is either a String or an Integer, and likely
34
+
// an Integer that is no larger than JavaScripts `Number.MAX_SAFE_INTEGER` since
35
+
// any JSON-RPC client interacting with a JavaScript peer wouldn't be able to send
36
+
// integer values larger than that without JavaScript converting that integer to a
37
+
// float, losing precision, and therefore not being able to associate requests/responses
38
+
// with the correct id.
39
+
returnjsonNode.asInt();
40
+
} elseif (jsonNode.isTextual()) {
41
+
returnjsonNode.asText();
42
+
} elseif (jsonNode.isNull()) {
43
+
returnnull;
44
+
} else {
45
+
thrownewIOException("A JSON-RPC ID according to the spec \"MUST contain a String, Number, or NULL value if included\". See §4 of https://www.jsonrpc.org/specification.");
0 commit comments