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

chore: simplify types #595

Closed

Conversation

lifeiscontent
Copy link
Contributor

@lifeiscontent lifeiscontent commented Apr 23, 2024

simplifying types to resolved types.

  1. Array<T> -> T[]
  2. Record<string | number | symbol, unknown> -> Record<keyof any, unknown> as it resolves to the same thing

@edmundhung
Copy link
Owner

I am sorry but this is probably a perspective of preference here as I don't see this simplifying the types. 😅

Personally I prefer Array<T> over T[] especially with complex type, e.g. (A | B | C)[] is much harder to read then Array<A | B | C>. Similarly, Record<keyof any, unknown> requires an additional thought of what keyof any is.

@lifeiscontent lifeiscontent deleted the chore/simplify-types branch April 24, 2024 16:35
@lifeiscontent
Copy link
Contributor Author

@edmundhung hey no worries, I've closed the branch :)

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.

None yet

2 participants