Skip to content

Commit c306514

Browse files
committed
cbor: decode undefined as null
See: ipfs/kubo#5776 This won't round-trip undef, it'll just convert it to null (which is what most decoders do anyways).
1 parent 0be8b03 commit c306514

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

encoding/unmarshaller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type Unmarshaller struct {
2626
// NewUnmarshallerAtlased creates a new reusable unmarshaller.
2727
func NewUnmarshallerAtlased(atl atlas.Atlas) *Unmarshaller {
2828
m := new(Unmarshaller)
29-
m.unmarshal = cbor.NewUnmarshallerAtlased(&m.reader, atl)
29+
m.unmarshal = cbor.NewUnmarshallerAtlased(cbor.DecodeOptions{CoerceUndefToNull: true}, &m.reader, atl)
3030
return m
3131
}
3232

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
},
4040
{
4141
"author": "why",
42-
"hash": "QmfWqohMtbivn5NRJvtrLzCW3EU4QmoLvVNtmvo9vbdtVA",
42+
"hash": "QmNScbpMAm3r2D25kmfQ43JCbQ8QCtai4V4DNz5ebuXUuZ",
4343
"name": "refmt",
44-
"version": "1.1.2"
44+
"version": "1.1.3"
4545
}
4646
],
4747
"gxVersion": "0.10.0",

0 commit comments

Comments
 (0)