i18next / i18next-browser-languageDetector

language detector used in browser environment for i18next
MIT License
873 stars 90 forks source link

perf: use object deconstruction, optional chaining and hot path optimisations #287

Closed VIKTORVAV99 closed 6 months ago

VIKTORVAV99 commented 6 months ago

This PR takes advantage of the changes in #286 to use object deconstruction, optional chaining and optimises some code hot paths with early returns and simplified nesting.

This should be functional equivalent to the current code but produce even smaller code bundles and be ever so slightly faster.

Checklist

Checklist (for documentation change)

adrai commented 6 months ago

landed in v8.0.0