question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Restrict decoding

See original GitHub issue

How can I restrict decoding a message in case where encoded message contain some values of types other than regular json supports (like ES6 Map/Set or sth), and discard it in decoded result, for example set it to undefined

Besides, very impressive work!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kriszypcommented, Jul 31, 2021

Yes. There isn’t a single option to change everything, but you can override the handling of individual tags by using addExtension with the tags you want to change, and what you want them to return:

 // return {} for tag 258, used for Sets:
CBOR.addExtension({tag:258, decode(){return {}}})
// return {} for tag 1, used for Dates
CBOR.addExtension({tag:1, decode(){return {}}})
// return {} for tag 259, used for Maps
CBOR.addExtension({tag:259, decode(){return {}}})
0reactions
kriszypcommented, Jul 31, 2021

Ok, I added the list of tags to the docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Block Decoding Minimum Distance Decoding Rule Derivation
http://adampanagos.orgWe derive the optimum decision rule for block coding on the binary symmetric channel (BSC).
Read more >
Instance Optimal Decoding and the Restricted Isometry Property
Abstract: In this paper, we address the question of information preservation in ill-posed, non-linear inverse problems, assuming that the ...
Read more >
restrict encoding/decoding credentials with a given key based ...
Add the ability to restrict encoding and decoding of credentials with a given key based on the request UID and/or GID. This would...
Read more >
Spring Boot: Prevent decoding for @RequestParam
I have a Spring-Boot (1.5.3) application running on a Tomcat 8.5. Within it, i have a RestController with a single parameter. This parameter...
Read more >
Block decoder - MATLAB decode - MathWorks
The decode function aims to recover messages that were encoded using an error-correction coding technique. The technique and the defining parameters must match ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found