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

refactor: use typesave utils #110

Merged
merged 2 commits into from
May 8, 2023
Merged

Conversation

EdJoPaTo
Copy link
Contributor

@EdJoPaTo EdJoPaTo commented Mar 17, 2023

Adds two type safe utils to work with JS builtins in a more type safe way.

Also prefer using Object.entries (or typedEntries) over Object.keys(obj) with manual access of the value obj[key] as indexed access could return undefined and TypeScript knows that (with noUncheckedIndexedAccess). Using entries there will contain the value so no need for another check.

(Part of #106)

src/helpers/rank.ts Outdated Show resolved Hide resolved
EdJoPaTo and others added 2 commits May 8, 2023 07:46
the new syntax works but is transpiled into usable code which is not so easy to read in JS

Co-authored-by: maxlath <[email protected]>
@maxlath maxlath merged commit ec4cd5f into maxlath:main May 8, 2023
@EdJoPaTo EdJoPaTo deleted the typesafe-utils branch July 18, 2023 10:13
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