algolia / instantsearch

⚡️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/
MIT License
3.73k stars 525 forks source link

fix(typescript): make recommendResults.params non-nullable #6296

Closed chrisvltn closed 4 months ago

chrisvltn commented 4 months ago

Summary

fixes https://github.com/algolia/instantsearch/issues/6295

params is declared here. As JSON.parse can never return undefined, this value can never be undefined either.

Result

I manually changed the type inside of the node_module in a Remix project and there was no type complaint anymore

codesandbox-ci[bot] commented 4 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit f6d38678ba34a1d9b0602688de4cb617884ea9d6:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration