Skip to content

Commit 8eeabaf

Browse files
authored
pretty (#46)
1 parent b80a6d4 commit 8eeabaf

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

borsh-ts/index.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import bs58 from "bs58";
44
// TODO: Make sure this polyfill not included when not required
55
import * as encoding from "text-encoding-utf-8";
66
const ResolvedTextDecoder =
7-
typeof TextDecoder !== "function"
8-
? encoding.TextDecoder
9-
: TextDecoder;
7+
typeof TextDecoder !== "function" ? encoding.TextDecoder : TextDecoder;
108
const textDecoder = new ResolvedTextDecoder("utf-8", { fatal: true });
119

1210
export function baseEncode(value: Uint8Array | string): string {
@@ -397,10 +395,15 @@ function deserializeField(
397395
const length = reader.readU32();
398396
for (let i = 0; i < length; i++) {
399397
const key = deserializeField(schema, fieldName, fieldType.key, reader);
400-
const val = deserializeField(schema, fieldName, fieldType.value, reader);
398+
const val = deserializeField(
399+
schema,
400+
fieldName,
401+
fieldType.value,
402+
reader
403+
);
401404
map.set(key, val);
402405
}
403-
return map
406+
return map;
404407
}
405408

406409
return deserializeStruct(schema, fieldType, reader);

0 commit comments

Comments
 (0)