Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Type Safety Guards to
turbo/fetch_requests
Without this change, GET `<form>` submissions without a Fetch Options `{ body: }` raise the following: ``` Uncaught TypeError: s.body is null <anonymous> fetch_requests.js:10 w turbo.es2017-esm.js:351 requestStarted turbo.es2017-esm.js:770 perform turbo.es2017-esm.js:520 start turbo.es2017-esm.js:744 formSubmitted turbo.es2017-esm.js:3369 ``` Through the exercise of attempting to [port the `turbo/fetch_requests` module to TypeScript](#392 (comment)), we've identified some potential edge cases in the algorithm that determines a request's HTTP method. Even if the migration to TypeScript doesn't come to fruition for some time, those edge cases should be addressed sooner rather than later. This commit adds more "type safety" motivated conditionals and guards to make sure that values are present before overriding them.
- Loading branch information