}
const body = (data as Record<string, unknown>) ?? {}
if ('action' in body && (typeof body.action !== 'string' || body.action.toLowerCase() !== action)) {
- throw new RangeError(`RPC post data contains 'action' property and does not match 'action' parameter argument. Do not include 'action' in request data.`)
+ throw new RangeError(`RPC post data contains 'action' property and does not match 'action' parameter argument. Do not include 'action' in request data.`, { cause: body })
}
body.action = action