fauna / fauna-js

Javascript driver for Fauna v10 (current)
https://fauna.com
Other
37 stars 7 forks source link

Validate cursor for feeds #296

Closed ecooper closed 4 weeks ago

ecooper commented 4 weeks ago

This PR adds a validation check for cursor and makes sure it's a string at runtime. Non-string values can produce vague error messages otherwise.

Description

This PR follows the current client configuration validation pattern to make sure cursor is a string when it is set.

Motivation and context

While testing this change internally, we discovered if you managed to pass a non-string cursor during runtime, the error returned wasn't very helpful. It's probably easiest to mitigate this by validating it.

How was the change tested?

Added a test to the existing client configuration tests. The existing tests still pass.

Change types

Checklist: