Closed accountingnerd closed 1 year ago
@ShawnTalbert -- I was pondering life in the shower the other day, and realized my mistake with the previous pull request. What do you think about this one? I dropped the "Extends" from the type argument.
Hi. Might want to export QueryResultsMap
so it can be referenced outside this file.
Just going by memory, is null
a value that actually gets returned by asMappedResults()
?
This also gets me thinking - we should probably have unit tests for all changes - they would act as documentation on how to use these types as well as protecting against regression. I see we have some work there under the /spec
folder but looks like it's just a start?
Addressing the questions:
asMap()
and asMappedResults()
functions.Hello, can we also export that type? I would like to type inside my library as QueryResultMap
.
I don't know that we need to export the type. It should be local to the module, and becomes available for use when (and if) you call the asMap() and asMappedResults() functions.
I think it should be, for example I use type string | number | boolean
rn, for my library that use asMap()
...
@GabrielGorta I don't see why not, do you want to do a pull request for that?
The functions
asMappedResults()
andasMap()
both had overloads that extendedObject
. This change creates a new type (QueryResultMap
) that allows us to further narrow the possible types returned by the Query object.