From dc9ad87548f11546b701a2945c780a8f49d3e308 Mon Sep 17 00:00:00 2001 From: gagdiez Date: Tue, 21 Nov 2023 12:07:07 +0000 Subject: [PATCH] Update README.md Updated API with correct `serialize` / `deserialize` parameters --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 973c230a..8a0bd1ad 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ const decoded = borsh.deserialize(schema, encoded); ## API The package exposes the following functions: -- `serialize(schema: Schema, obj: any): Uint8Array` - serializes an object `obj` according to the schema `schema`. -- `deserialize(schema: Schema, buffer: Uint8Array, class?: Class): any` - deserializes an object according to the schema `schema` from the buffer `buffer`. If the optional parameter `class` is present, the deserialized object will be an of `class`. +- `serialize(schema: Schema, obj: any, validate: boolean = true): Uint8Array` - serializes an object `obj` according to the schema `schema`. Setting `validate` to false will skip the validation of the `schema`. +- `deserialize(schema: Schema, buffer: Uint8Array, validate: boolean = true): any` - deserializes an object according to the schema `schema` from the buffer `buffer`. Setting `validate` to false will skip the validation of the `schema`. ## Schemas Schemas are used to describe the structure of the data being serialized or deserialized. They are used to