@mysten/bcs
Advanced tools
Comparing version 0.0.0-experimental-20240531194956 to 0.0.0-experimental-20240603183408
# Change Log | ||
## 0.0.0-experimental-20240531194956 | ||
## 0.0.0-experimental-20240603183408 | ||
### Patch Changes | ||
- 369b924343: Improve error messages when attempting to serialze non-array values that should be arrays | ||
## 1.0.1 | ||
### Patch Changes | ||
- f1e828f557: Remove undefined from bcs.option output types | ||
@@ -8,0 +14,0 @@ |
@@ -171,3 +171,3 @@ "use strict"; | ||
options?.validate?.(value); | ||
if (!("length" in value)) { | ||
if (!value || typeof value !== "object" || !("length" in value)) { | ||
throw new TypeError(`Expected array, found ${typeof value}`); | ||
@@ -219,3 +219,3 @@ } | ||
options?.validate?.(value); | ||
if (!("length" in value)) { | ||
if (!value || typeof value !== "object" || !("length" in value)) { | ||
throw new TypeError(`Expected array, found ${typeof value}`); | ||
@@ -282,3 +282,3 @@ } | ||
options?.validate?.(value); | ||
if (!("length" in value)) { | ||
if (!value || typeof value !== "object" || !("length" in value)) { | ||
throw new TypeError(`Expected array, found ${typeof value}`); | ||
@@ -285,0 +285,0 @@ } |
@@ -156,3 +156,3 @@ import { | ||
options?.validate?.(value); | ||
if (!("length" in value)) { | ||
if (!value || typeof value !== "object" || !("length" in value)) { | ||
throw new TypeError(`Expected array, found ${typeof value}`); | ||
@@ -204,3 +204,3 @@ } | ||
options?.validate?.(value); | ||
if (!("length" in value)) { | ||
if (!value || typeof value !== "object" || !("length" in value)) { | ||
throw new TypeError(`Expected array, found ${typeof value}`); | ||
@@ -267,3 +267,3 @@ } | ||
options?.validate?.(value); | ||
if (!("length" in value)) { | ||
if (!value || typeof value !== "object" || !("length" in value)) { | ||
throw new TypeError(`Expected array, found ${typeof value}`); | ||
@@ -270,0 +270,0 @@ } |
{ | ||
"name": "@mysten/bcs", | ||
"version": "0.0.0-experimental-20240531194956", | ||
"version": "0.0.0-experimental-20240603183408", | ||
"description": "BCS - Canonical Binary Serialization implementation for JavaScript", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -170,3 +170,3 @@ // Copyright (c) Mysten Labs, Inc. | ||
options?.validate?.(value); | ||
if (!('length' in value)) { | ||
if (!value || typeof value !== 'object' || !('length' in value)) { | ||
throw new TypeError(`Expected array, found ${typeof value}`); | ||
@@ -224,3 +224,3 @@ } | ||
options?.validate?.(value); | ||
if (!('length' in value)) { | ||
if (!value || typeof value !== 'object' || !('length' in value)) { | ||
throw new TypeError(`Expected array, found ${typeof value}`); | ||
@@ -296,3 +296,3 @@ } | ||
options?.validate?.(value); | ||
if (!('length' in value)) { | ||
if (!value || typeof value !== 'object' || !('length' in value)) { | ||
throw new TypeError(`Expected array, found ${typeof value}`); | ||
@@ -299,0 +299,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
346554