Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Updated API with correct `serialize` / `deserialize` parameters
  • Loading branch information
gagdiez authored Nov 21, 2023
1 parent ccf0b00 commit dc9ad87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dc9ad87

Please sign in to comment.