Skip to content

Improved type for Value#31

Open
daytonlowell wants to merge 1 commit intomasterfrom
improve-value-type
Open

Improved type for Value#31
daytonlowell wants to merge 1 commit intomasterfrom
improve-value-type

Conversation

@daytonlowell
Copy link
Collaborator

We were switching some code in one of our apps to use one of our own wrappers for interacting with a mysql db, in doing so we got TS errors that we traced back to the usage of the object type in sql-concat.

I believe there are some gotchas with the object type in TS.

let x: object = { a: 1 }

x.a // Error Property 'a' does not exist on type 'object'.

Record<string, unknown> is a more specific type.

That being said, it would appear that both mysql2 and @types/mysql use any for the value prop, so maybe we should just do the same?

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.

1 participant