Skip to content
Permalink
Browse files

cbor: decode undefined as null

See: ipfs/go-ipfs#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 c3065144f09ce1edc1ecd273bc378baec1a82be0
Showing with 3 additions and 3 deletions.
  1. +1 −1 encoding/unmarshaller.go
  2. +2 −2 package.json
@@ -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
}

@@ -39,9 +39,9 @@
},
{
"author": "why",
"hash": "QmfWqohMtbivn5NRJvtrLzCW3EU4QmoLvVNtmvo9vbdtVA",
"hash": "QmNScbpMAm3r2D25kmfQ43JCbQ8QCtai4V4DNz5ebuXUuZ",
"name": "refmt",
"version": "1.1.2"
"version": "1.1.3"
}
],
"gxVersion": "0.10.0",

0 comments on commit c306514

Please sign in to comment.
You can’t perform that action at this time.