Skip to content
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

Some of features in decode, present package change the input object. #163

Closed
lukasjhan opened this issue Mar 12, 2024 · 2 comments · Fixed by #181
Closed

Some of features in decode, present package change the input object. #163

lukasjhan opened this issue Mar 12, 2024 · 2 comments · Fixed by #181
Assignees
Labels
bug An issue with the system 🐛.

Comments

@lukasjhan
Copy link
Member

What I found out while implementing PEX is that there are functions that directly modify objects received as input. I think this will confuse users, so I think I'll have to copy the object internally and use it.

I proposed:

  • use after deep clone inside

selectDisclosures in @sd-jwt/present

  • comments or write a docs that this function change the input.

unpack, unpackSync, unpackObj and unpackArray in @sd-jwt/decode

@lukasjhan lukasjhan added the bug An issue with the system 🐛. label Mar 12, 2024
@lukasjhan lukasjhan self-assigned this Mar 12, 2024
@lukasjhan
Copy link
Member Author

@cre8 What do you think about it? If you think it's good, I'll make a PR today :)

@cre8
Copy link
Contributor

cre8 commented Mar 16, 2024

@lukasjhan I think this is a good idea to avoid side effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue with the system 🐛.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants