From c1f471e921930e5f1a1ab9a087b8ea894f985345 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sat, 18 Nov 2023 06:44:13 -0500 Subject: [PATCH] fix: need to use Object.entries --- src/node.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/node.ts b/src/node.ts index d9fe933..0b31303 100644 --- a/src/node.ts +++ b/src/node.ts @@ -161,7 +161,15 @@ export class S5Node { const innerMapLength = unpacker.unpackMapLength(); for (let j = 0; j < innerMapLength; j++) { const nodeId = new NodeId(unpacker.unpackBinary()); - innerMap.set(nodeId, new Map(unpacker.unpackMap() as [number, any][])); + innerMap.set( + nodeId, + new Map( + Object.entries(unpacker.unpackMap()).map(([key, value]) => [ + Number(key), + value, + ]), + ), + ); } } return map;