@mysten/bcs
Advanced tools
Comparing version 1.0.1 to 1.0.2
# Change Log | ||
## 1.0.2 | ||
### Patch Changes | ||
- 369b924343: Improve error messages when attempting to serialze non-array values that should be arrays | ||
## 1.0.1 | ||
@@ -4,0 +10,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": "1.0.1", | ||
"version": "1.0.2", | ||
"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
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
346498