-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(codec): molecule friendly error message #403
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
c8d4256
to
2820385
Compare
Codecov Report
@@ Coverage Diff @@
## develop #403 +/- ##
===========================================
+ Coverage 81.98% 82.13% +0.14%
===========================================
Files 93 94 +1
Lines 19105 19269 +164
Branches 1794 1820 +26
===========================================
+ Hits 15664 15826 +162
- Misses 3400 3401 +1
- Partials 41 42 +1
Continue to review full report at Codecov.
|
Can you add description and purpose about this pull request? |
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'm wondering if it's possible to use the higher-order function to do non-intrusive modifications instead of directly changing the codec
?
maybe example like that
withReadableError(array)(xxxx)
851b20e
to
8990ac8
Compare
It is difficult. We want track the property access path in codec pack input, but these key only appears in When code run out of these high order function, we can not get the current key anymore. so I think we have to modify some code in codec pack logic. |
vote for this. but i want to know it is possible to refactor |
Maybe ES6 proxy class can implement this feature. |
it can be simpler function struct(shape, fields) {
const codec = createObjectCodec(...)
return {
pack(packable) {
const packedFields = fields.map(field => codec[field].pack(packable[item]))
return concat(...packedFields)
}
unpack() {
// ...
}
}
} |
I found a way to track layout struct( This can be in another PR in #408 |
e6cbfe2
to
c46c3c4
Compare
c46c3c4
to
7b5ce1c
Compare
7b5ce1c
to
91536a4
Compare
Co-authored-by: Yonghui Lin <homura.dev@gmail.com>
Co-authored-by: Yonghui Lin <homura.dev@gmail.com>
Seems everything is OK. Can you please help review again? @homura |
#396