bitcoinjs / bolt11

A library for encoding and decoding lightning network payment requests as defined in BOLT #11.
MIT License
93 stars 65 forks source link

Add getTagsObject function #61

Closed junderw closed 2 years ago

junderw commented 2 years ago

Replaces #60

@dylancom Please review.

dylancom commented 2 years ago

Nice work. Might be an idea to have tagsObject directly available on the decoded obj (next to tags)?

junderw commented 2 years ago

Feel free to make a PR to this branch. I'll leave this open until you figure out what you want to do.

Currently there are a lot of assumptions baked into the tests which I don't want to break.

Before pushing your new PR, locally run npm ci to install dependencies and run npm run lint && npm run coverage to make sure all the lints, tests, and coverage work on your changes. Then push.

junderw commented 2 years ago

I guess it could be made into a getter somehow?

But a lot of the tests check that encode(decode(x)) === decode(x) sooooo it might be difficult to mix in all those keys.

dylancom commented 2 years ago

Tried adding a getter but failed to match fixtures.json. I added tagsObject like I suggested and adjusted the tests.

62

dylancom commented 2 years ago

Great!

junderw commented 2 years ago

published as v1.4.0