A more user-friendly API
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 881
- Forks
- 113
- PR merge metrics
- No merged PRs in 30d
Description
Is anyone here opposed to maybe adding a more user-friendly API to this library.
Right now it takes a fair amount of boilerplate to do what is essentially `JSON.parse(encoded)` or `JSON.stringify(obj)`.
Plus, there doesn't seem to be a way to get the same objects out on the decode end as were put into the encoding step. This means even more boilerplate code to translate certain fields from numbers into enum strings. Considering this is probably the most common use case it seems worth it to make this a simple one-step call like `buffer = encode(schema, obj)` and `obj = decode(schema, buffer)`. And preferably, the input to encode and the output of decode should have deep equality.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the library's current encode and decode entry points and how they relate to JSON.parse and JSON.stringify. Define the public API and schema behavior needed for one-step calls, including preservation of object values and deep equality between the encoded input and decoded output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100