decentralized-identity / decentralized-identity/web5-js
Improve code reuse and readability of Web5 User Agent
- Dominant language
- TypeScript
- Stars
- 142
- Forks
- 56
- PR merge metrics
- No merged PRs in 30d
Description
Evaluate and refactor `packages/web5-user-agent/src/web5-user-agent.ts`
similar / duplicative code in `sendDwnRequest()` and `constructDwnMessage()`:
https://github.com/TBD54566975/web5-js/blob/3fbd36c5eab43e72d6e153beb618808bcd8c574b/packages/web5-user-agent/src/web5-user-agent.ts#L136-L153
https://github.com/TBD54566975/web5-js/blob/3fbd36c5eab43e72d6e153beb618808bcd8c574b/packages/web5-user-agent/src/web5-user-agent.ts#L248-L254
Likely separate into its own method:
https://github.com/TBD54566975/web5-js/blob/3fbd36c5eab43e72d6e153beb618808bcd8c574b/packages/web5-user-agent/src/web5-user-agent.ts#L242-L274
Depending on the path forward with Node.js `Readable` vs. Web `ReadableStream` refactor and consider moving portions to HTTP transport methods:
https://github.com/TBD54566975/web5-js/blob/3fbd36c5eab43e72d6e153beb618808bcd8c574b/packages/web5-user-agent/src/web5-user-agent.ts#L276-L304
Contributor guide
Assessment
This issue has not been assessed yet.