feat: allow objects to be supplied as map keys (#5128)

This commit is contained in:
Yaroslav Bolyukin
2022-08-04 15:02:22 +03:00
committed by GitHub
parent 77a9b2bfdf
commit 296cffa266
+1 -1
View File
@@ -46,7 +46,7 @@ function decodeMapFromMap<K extends Codec, V extends Codec> (registry: Registry,
output.set(
key instanceof KeyClass
? key
: new KeyClass(registry, isComplex ? JSON.parse(key as string) : key),
: new KeyClass(registry, isComplex && typeof key === 'string' ? JSON.parse(key) : key),
val instanceof ValClass
? val
: new ValClass(registry, val)