Skip to content

Commit fa2662d

Browse files
committed
formatting
1 parent 044146a commit fa2662d

File tree

1 file changed

+6
-8
lines changed
  • packages/core/src/submodules/cbor

1 file changed

+6
-8
lines changed

packages/core/src/submodules/cbor/cbor.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
1010
/**
1111
*
1212
*/
13-
type CborListType<T = any> = Array<T>;
14-
type CborMapType<T = any> = Record<string, T>;
15-
16-
type CborCollectionType<T = any> = CborMapType<T> | CborListType<T>;
17-
type CborItemType = undefined | boolean | number | [CborSliceType, Uint64Imprecise] | string;
13+
type CborItemType = undefined | boolean | number | [CborSliceType, Uint64Imprecise] | string | CborTagType;
1814
type CborTagType = {
1915
tag: Uint64Imprecise;
2016
value: CborValueType;
2117
};
18+
type CborSliceType = Uint8Array;
19+
type CborListType<T = any> = Array<T>;
20+
type CborMapType<T = any> = Record<string, T>;
21+
type CborCollectionType<T = any> = CborMapType<T> | CborListType<T>;
2222

2323
type CborValueType = CborItemType | CborCollectionType | any;
2424

@@ -33,8 +33,6 @@ type Uint64Imprecise = number;
3333
type Float16 = number;
3434
type Float32 = number;
3535

36-
type CborSliceType = Uint8Array;
37-
3836
type CborMajorType =
3937
| typeof majorUint64
4038
| typeof majorNegativeInt64
@@ -165,7 +163,7 @@ const readArgument = (payload: Uint8Array, byteLength: number): Uint64Imprecise
165163
if (byteLength === 2) return offsetDataView(payload).getUint16(0);
166164
if (byteLength === 4) return offsetDataView(payload).getUint32(0);
167165

168-
// TODO: warning, truncation
166+
// TODO(cbor): warning, loss of precision.
169167
return Number(offsetDataView(payload).getBigUint64(0));
170168
};
171169

0 commit comments

Comments
 (0)