2.4.16
- support
Record<string, something>
data type, please note Typescript keys collapsing behavior:
playground
- due to TS keys collapsing behavior ('a' | 'string' collapses to 'string'), be careful when accessing meta type
compare
andwriteFlatten
indexes with dot notation keys if keys consisting ofstring
.
For example:User['compare'][`a.${string}.b`]
will returnnever
becausea.h.b
collapse stoa.${string}
.
The solution is to access indexes by layer:User['compare']['a'][string]['b']
- This update changed some core logics while ensuring backward compatibility, so existing code should be fine. New data type requires a lot of tests but because of time constraint and complexity, I only added minimum amount of tests. Helps are appreciated
- new APIs:
transaction.updateNoFlatten
,batch.updateNoFlatten
, andupdateDocNoFlatten
. These APIs behave exactly the same as officialupdate
: they will delete nested properties(non-top level properties) that are NOT included.
related issue: #20