Skip to content

Commit

Permalink
cbor: decode undefined as null
Browse files Browse the repository at this point in the history
See: ipfs/kubo#5776

This won't round-trip undef, it'll just convert it to null (which is what most
decoders do anyways).
  • Loading branch information
Stebalien committed Nov 30, 2018
1 parent 0be8b03 commit c306514
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion encoding/unmarshaller.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Unmarshaller struct {
// NewUnmarshallerAtlased creates a new reusable unmarshaller.
func NewUnmarshallerAtlased(atl atlas.Atlas) *Unmarshaller {
m := new(Unmarshaller)
m.unmarshal = cbor.NewUnmarshallerAtlased(&m.reader, atl)
m.unmarshal = cbor.NewUnmarshallerAtlased(cbor.DecodeOptions{CoerceUndefToNull: true}, &m.reader, atl)
return m
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
},
{
"author": "why",
"hash": "QmfWqohMtbivn5NRJvtrLzCW3EU4QmoLvVNtmvo9vbdtVA",
"hash": "QmNScbpMAm3r2D25kmfQ43JCbQ8QCtai4V4DNz5ebuXUuZ",
"name": "refmt",
"version": "1.1.2"
"version": "1.1.3"
}
],
"gxVersion": "0.10.0",
Expand Down

0 comments on commit c306514

Please sign in to comment.