Replies: 10 comments
-
In my opinion, we should stick with the name |
Beta Was this translation helpful? Give feedback.
-
@bgins they're different! Parse is equivalent to |
Beta Was this translation helpful? Give feedback.
-
@expede Yep, I'm aware they are different. I didn't state that very well. I think that most developers won't be familiar with the term |
Beta Was this translation helpful? Give feedback.
-
What should the result type for Also big 👍 for adding stuff to the library, informed by usage sites. This makes sense. |
Beta Was this translation helpful? Give feedback.
-
What would you think about making this even less safe? 😆 Something like |
Beta Was this translation helpful? Give feedback.
-
I was thinking about this some more, and we should consider what tools might want to use the raw decode function. The use case I mention above is something that would be useful in ucan.xyz, but the safer type may be better for other tools and internally in |
Beta Was this translation helpful? Give feedback.
-
Just trying to understand: Would you say this unsafe decode function belongs into ucan.xyz and we should close this issue? Or is there something that you think belongs into ts-ucan? |
Beta Was this translation helpful? Give feedback.
-
For a raw decoding function to be useful in ucan.xyz, it should only check that a token has three sections, the sections are seperated by We do these steps in the I would propose we:
Does that sound like a good way to approach this? |
Beta Was this translation helpful? Give feedback.
-
Hm. I think that means there's no one blocked by us putting a raw decoding function into |
Beta Was this translation helpful? Give feedback.
-
Agreed. Let's hold on this for now. 👌 One use case I can imagine for raw decoding is debugging while developing an app, but once we have raw decoding in ucan.xyz, that should fulfill that use case. Some developers may still want the raw decoding function, but we can hold off until someone requests it. |
Beta Was this translation helpful? Give feedback.
-
Summary
Problem
ts-ucan
does not provide a raw decoding function.Impact
Tools that wish to inspect a UCAN in its raw form are unable to do so without some level of parsing/validation.
Solution
Provide a raw decoding function.
Detail
Is your feature request related to a problem? Please describe.
Tools that wish to inspect a defective UCAN are unable to do so.
Describe the solution you'd like
The raw decoding function should:
.
separatorsNaming and/or namespacing will be an important consideration for the last point. A few possibilities:
ucan.unsafeDecode
ucan.unutterableFoulDecode
subtle
, for exampleucan.subtle.unsafeDecode
internal
as a namespace whereucan.internal.decode + ucan.internal.validate => ucan.validate
parse
instead ofvalidate
, because the that's decode + validate{insert-bikeshedding-here}
Describe alternatives you've considered
Developers can write their own raw decoding function.
Beta Was this translation helpful? Give feedback.
All reactions