Closed cy6581 closed 10 months ago
Hello,
Based on what's documented in the README: A buffer containing an option type should deserialize to null if the value is of type None, or to the specific type if the value is Some https://github.com/near/borsh-js/blob/6db74764cedb88097bd6d5636407f0b3481fba4c/README.md?plain=1#L44
option
null
None
Some
However, the implementation in deserializeField seems to be returning undefined instead of null. https://github.com/near/borsh-js/blob/6db74764cedb88097bd6d5636407f0b3481fba4c/borsh-ts/index.ts#L391
deserializeField
undefined
Is this an oversight? Be happy to put in a PR for a quick change.
Thanks!
Hi, wondering if there's anyone who could clarify on this?
Hello,
Based on what's documented in the README: A buffer containing an
option
type should deserialize tonull
if the value is of typeNone
, or to the specific type if the value isSome
https://github.com/near/borsh-js/blob/6db74764cedb88097bd6d5636407f0b3481fba4c/README.md?plain=1#L44However, the implementation in
deserializeField
seems to be returningundefined
instead ofnull
. https://github.com/near/borsh-js/blob/6db74764cedb88097bd6d5636407f0b3481fba4c/borsh-ts/index.ts#L391Is this an oversight? Be happy to put in a PR for a quick change.
Thanks!