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

add functionality to see registered tags #53

Merged
merged 4 commits into from
Dec 3, 2024
Merged

Conversation

irfan798
Copy link
Contributor

@irfan798 irfan798 commented Dec 2, 2024

Added functionality to show all registered decoders and tags in the registry.

We need this functionality as part of our BC-UR registry https://github.com/ngraveio/bc-ur/tree/feature/bc-ur-v2

@hildjj
Copy link
Owner

hildjj commented Dec 2, 2024

Please fix lint issues and add yourself to a new "contributors" section in the package.json right after "author".

@codecov-commenter
Copy link

codecov-commenter commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (ca1a30e) to head (57f131d).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #53   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           17        17           
  Lines         4028      4045   +17     
  Branches       585       585           
=========================================
+ Hits          4028      4045   +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/tag.ts Show resolved Hide resolved
src/tag.ts Outdated
public static getAllDecoders(): {
[key: string]: TagDecoder;
} {
return Object.fromEntries(this.#tags);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize you could do this with Map. Nifty. Are you sure you want to lose the type info from TagNumber?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object cannot have BigInt as key so we have to loose info while converting to an object but we can return a clone of the map or the map itself just like version 1 of this library

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a clone of the Map might be best.

@hildjj
Copy link
Owner

hildjj commented Dec 3, 2024

This lgtm. Thanks!

I'll get a release out soon, but I need to fix another issue first.

@hildjj hildjj merged commit e397db9 into hildjj:main Dec 3, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants