ipld / ipld/js-dag-json

encoding object with `/` field should drop other feilds

Open
#86 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
23
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Here is an example code to reproduce the problem:

```js
const block = json.encode({
hello: {
'/': 'baguqeeratmwuhl736sndm4bi34xbifhyjqhatgwjrq6vjkfiafl7253rv4sq',
message: 'hello'
}
})

const data = json.decode(block) // Error: Invalid encoded CID form
```

I would expect encoder to just ignore `message` field of the `hello` and encode it as link as opposed to encoding it into an invalid block.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.