-
Notifications
You must be signed in to change notification settings - Fork 26
Conversation
const src = { | ||
data: 'hello world', | ||
size: 11, | ||
'@link': 'hello-world' | ||
l1: {'&': 'hello-world'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry i think we went for /
may be good to make this a constant?
I'm not a big fan of |
@@ -72,11 +70,15 @@ exports.unmarshal = (input, opts) => { | |||
if (val instanceof cbor.Tagged) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use Duck Typing instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that will work very well, we want this exact thing, not something that looks like it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just because a tiny change in the version, a module that gets 'reused' and suddenly this verification doesn't work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this can not happen here. We require cbor
at the top and call cbor.decode
and then check the decoded output against cbor.Tagged
so this will always reference the same version of cbor
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, missed that, it is actually a very good point/guard. Can we add a comment so that the same question doesn't raise after?
thanks for changing to |
LGTM :) |
Ref: ipfs/specs#97