@smithy/core 3.9.0 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/submodules/serde/index.js +2 -2
- package/dist-es/submodules/cbor/byte-printer.js +35 -1
- package/dist-es/submodules/serde/value/NumericValue.js +4 -2
- package/dist-types/submodules/cbor/cbor-types.d.ts +1 -1
- package/dist-types/ts3.4/submodules/cbor/cbor-types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -653,11 +653,11 @@ var NumericValue = class _NumericValue {
|
|
|
653
653
|
return false;
|
|
654
654
|
}
|
|
655
655
|
const _nv = object;
|
|
656
|
-
const prototypeMatch = _NumericValue.prototype.isPrototypeOf(object
|
|
656
|
+
const prototypeMatch = _NumericValue.prototype.isPrototypeOf(object);
|
|
657
657
|
if (prototypeMatch) {
|
|
658
658
|
return prototypeMatch;
|
|
659
659
|
}
|
|
660
|
-
if (typeof _nv.string === "string" && typeof _nv.type === "string" && _nv.constructor?.name
|
|
660
|
+
if (typeof _nv.string === "string" && typeof _nv.type === "string" && _nv.constructor?.name?.endsWith("NumericValue")) {
|
|
661
661
|
return true;
|
|
662
662
|
}
|
|
663
663
|
return prototypeMatch;
|
|
@@ -1,3 +1,37 @@
|
|
|
1
1
|
export function printBytes(bytes) {
|
|
2
|
-
return [...bytes].map((n) =>
|
|
2
|
+
return [...bytes].map((n) => {
|
|
3
|
+
const pad = (num) => ("0".repeat(8) + num.toString(2)).slice(-8);
|
|
4
|
+
const b = pad(n);
|
|
5
|
+
const [maj, min] = [b.slice(0, 3), b.slice(3)];
|
|
6
|
+
let dmaj = "";
|
|
7
|
+
switch (maj) {
|
|
8
|
+
case "000":
|
|
9
|
+
dmaj = "0 - Uint64";
|
|
10
|
+
break;
|
|
11
|
+
case "001":
|
|
12
|
+
dmaj = "1 - Neg Uint64";
|
|
13
|
+
break;
|
|
14
|
+
case "010":
|
|
15
|
+
dmaj = "2 - unstructured bytestring";
|
|
16
|
+
break;
|
|
17
|
+
case "011":
|
|
18
|
+
dmaj = "3 - utf8 string";
|
|
19
|
+
break;
|
|
20
|
+
case "100":
|
|
21
|
+
dmaj = "4 - list";
|
|
22
|
+
break;
|
|
23
|
+
case "101":
|
|
24
|
+
dmaj = "5 - map";
|
|
25
|
+
break;
|
|
26
|
+
case "110":
|
|
27
|
+
dmaj = "6 - tag";
|
|
28
|
+
break;
|
|
29
|
+
case "111":
|
|
30
|
+
dmaj = "7 - special";
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
dmaj = String(parseInt(maj, 2));
|
|
34
|
+
}
|
|
35
|
+
return `${maj}_${min} (${dmaj}, ${parseInt(min, 2)})`;
|
|
36
|
+
});
|
|
3
37
|
}
|
|
@@ -28,11 +28,13 @@ export class NumericValue {
|
|
|
28
28
|
return false;
|
|
29
29
|
}
|
|
30
30
|
const _nv = object;
|
|
31
|
-
const prototypeMatch = NumericValue.prototype.isPrototypeOf(object
|
|
31
|
+
const prototypeMatch = NumericValue.prototype.isPrototypeOf(object);
|
|
32
32
|
if (prototypeMatch) {
|
|
33
33
|
return prototypeMatch;
|
|
34
34
|
}
|
|
35
|
-
if (typeof _nv.string === "string" &&
|
|
35
|
+
if (typeof _nv.string === "string" &&
|
|
36
|
+
typeof _nv.type === "string" &&
|
|
37
|
+
_nv.constructor?.name?.endsWith("NumericValue")) {
|
|
36
38
|
return true;
|
|
37
39
|
}
|
|
38
40
|
return prototypeMatch;
|
|
@@ -37,7 +37,7 @@ export declare const extendedFloat16 = 25;
|
|
|
37
37
|
export declare const extendedFloat32 = 26;
|
|
38
38
|
export declare const extendedFloat64 = 27;
|
|
39
39
|
export declare const minorIndefinite = 31;
|
|
40
|
-
export declare function alloc(size: number): Uint8Array
|
|
40
|
+
export declare function alloc(size: number): Uint8Array;
|
|
41
41
|
/**
|
|
42
42
|
* @public
|
|
43
43
|
*
|
|
@@ -40,7 +40,7 @@ export declare const extendedFloat16 = 25;
|
|
|
40
40
|
export declare const extendedFloat32 = 26;
|
|
41
41
|
export declare const extendedFloat64 = 27;
|
|
42
42
|
export declare const minorIndefinite = 31;
|
|
43
|
-
export declare function alloc(size: number): Uint8Array
|
|
43
|
+
export declare function alloc(size: number): Uint8Array;
|
|
44
44
|
/**
|
|
45
45
|
* @public
|
|
46
46
|
*
|
package/package.json
CHANGED