@mysten/bcs
Advanced tools
Comparing version 0.0.0-experimental-20240717180855 to 0.0.0-experimental-20240806174754
# Change Log | ||
## 0.0.0-experimental-20240717180855 | ||
## 0.0.0-experimental-20240806174754 | ||
### Patch Changes | ||
- f37b3c2: Improve error message when bcs enum contains unknown value | ||
## 1.0.3 | ||
### Patch Changes | ||
- 7fc464a: Remove unique symbols from types to improve compatability between version | ||
@@ -8,0 +14,0 @@ - 0f27a97: Update dependencies |
@@ -402,6 +402,10 @@ "use strict"; | ||
const index = reader.readULEB(); | ||
const [name2, type] = canonicalOrder[index]; | ||
const enumEntry = canonicalOrder[index]; | ||
if (!enumEntry) { | ||
throw new TypeError(`Unknown value ${index} for enum ${name}`); | ||
} | ||
const [kind, type] = enumEntry; | ||
return { | ||
[name2]: type?.read(reader) ?? true, | ||
$kind: name2 | ||
[kind]: type?.read(reader) ?? true, | ||
$kind: kind | ||
}; | ||
@@ -408,0 +412,0 @@ }, |
@@ -387,6 +387,10 @@ import { | ||
const index = reader.readULEB(); | ||
const [name2, type] = canonicalOrder[index]; | ||
const enumEntry = canonicalOrder[index]; | ||
if (!enumEntry) { | ||
throw new TypeError(`Unknown value ${index} for enum ${name}`); | ||
} | ||
const [kind, type] = enumEntry; | ||
return { | ||
[name2]: type?.read(reader) ?? true, | ||
$kind: name2 | ||
[kind]: type?.read(reader) ?? true, | ||
$kind: kind | ||
}; | ||
@@ -393,0 +397,0 @@ }, |
{ | ||
"name": "@mysten/bcs", | ||
"version": "0.0.0-experimental-20240717180855", | ||
"version": "0.0.0-experimental-20240806174754", | ||
"description": "BCS - Canonical Binary Serialization implementation for JavaScript", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -484,6 +484,13 @@ // Copyright (c) Mysten Labs, Inc. | ||
const index = reader.readULEB(); | ||
const [name, type] = canonicalOrder[index]; | ||
const enumEntry = canonicalOrder[index]; | ||
if (!enumEntry) { | ||
throw new TypeError(`Unknown value ${index} for enum ${name}`); | ||
} | ||
const [kind, type] = enumEntry; | ||
return { | ||
[name]: type?.read(reader) ?? true, | ||
$kind: name, | ||
[kind]: type?.read(reader) ?? true, | ||
$kind: kind, | ||
} as never; | ||
@@ -490,0 +497,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
349941
4870