Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove chance of unexpected type coercion and remove unnecessary param to TextEncoder #286

Merged
merged 1 commit into from
Oct 20, 2023
Merged

Conversation

Anupya
Copy link
Contributor

@Anupya Anupya commented Oct 20, 2023

In this PR:

  • Use === instead of == and !== instead of != as the latter may cause unexpected type coercion [source].
  • TextEncoder only supports utf-8 and does not accept any input params [source]. So we should declare it like TextEncoder instead of TextEncoder('utf-8').
  • Use const/let instead of var where appropriate.
  • Remove stringify-object as it is unused because pretty is unused.

@Anupya Anupya changed the title remove chance of unexpected type coercion and unnecessary param Remove chance of unexpected type coercion and remove unnecessary param to TextEncoder Oct 20, 2023
@Anupya Anupya marked this pull request as ready for review October 20, 2023 15:29
@niklasf niklasf merged commit 41b8380 into lichess-org:master Oct 20, 2023
1 check passed
@niklasf
Copy link
Member

niklasf commented Oct 20, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants