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

chore(js-ts): Convert app/util/bytes.js to TypeScript #11275

Merged
merged 2 commits into from
Sep 25, 2024

Conversation

devin-ai-integration[bot]
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Sep 18, 2024

Pull Request Description

Motivation

This pull request aims to convert the bytes.js file to TypeScript, improving type safety and maintainability of the codebase.

Context

As part of our ongoing efforts to migrate the MetaMask Mobile codebase to TypeScript, we are converting JavaScript files to TypeScript one at a time. This PR focuses on the bytes.js utility file.

Changes

  • Renamed app/util/bytes.js to app/util/bytes.ts
  • Added type annotations for the function parameter and return value
  • Refactored the for loop to a for-of loop to address potential linting issues
  • Created notes.md to track TODOs and type-related considerations

Files Changed

  1. app/util/bytes.ts (renamed from bytes.js)
  2. notes.md (new file)

Testing

  • Ran yarn tsc to ensure successful TypeScript compilation
  • Ran yarn lint to check for any linting issues

Notes

  • The value parameter type is currently set to Uint8Array, but we may need to consider allowing number[] as well in the future.
  • All existing functionality should remain unchanged.

Checklist

  • Code follows the MetaMask Coding Standards
  • Tests for the changes have been added (if applicable)
  • All tests pass
  • Lint and prettier checks pass
  • This PR is ready for review

Link to Devin run

https://preview.devin.ai/devin/0a3389f83f8d4560bdce6a8a5a186bdd

Additional Information

This pull request was created by Devin at the request of Moritz.

If you have any feedback, you can leave comments in the PR and I'll address them in the app!

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@devin-ai-integration devin-ai-integration bot changed the title chore: Convert bytes.js to TypeScript chore(js-ts): Convert app/util/bytes.js to TypeScript Sep 18, 2024
@devin-ai-integration devin-ai-integration bot added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) team-mobile-platform No QA Needed Apply this label when your PR does not need any QA effort. labels Sep 18, 2024
@devin-ai-integration devin-ai-integration bot marked this pull request as ready for review September 18, 2024 17:14
@devin-ai-integration devin-ai-integration bot requested a review from a team as a code owner September 18, 2024 17:14
Copy link

@smilingkylan smilingkylan added this pull request to the merge queue Sep 25, 2024
Merged via the queue into main with commit 0a983a4 Sep 25, 2024
36 checks passed
@smilingkylan smilingkylan deleted the convert-ts-bytes branch September 25, 2024 00:52
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Sep 25, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Sep 25, 2024
@metamaskbot metamaskbot added the release-7.33.0 Issue or pull request that will be included in release 7.33.0 label Sep 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No QA Needed Apply this label when your PR does not need any QA effort. release-7.33.0 Issue or pull request that will be included in release 7.33.0 team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants