MetaMask / MetaMask/metamask-extension

[Typescript Conversion: Level 21]: Convert ui/helpers/utils/util.js to typescript

Open
#31,786 0 comments 0 reactions 1 assignee View on GitHub

@MajorLift is already working on this.

Since Apr 10, 2025.

INVALID-ISSUE-TEMPLATE team-extension-platform
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

## **Description**

Convert `ui/helpers/utils/util.js` from JavaScript to TypeScript as part of the TS migration initiative.

## **Scenario (for user stories only)**

_(Not applicable)_

## **Design (for user stories only)**

_(Not applicable)_

## **Technical Details (for technical tasks only)**

- Convert this file to TypeScript.
- Migration Level: **21**
- Dependencies:
- shared/constants/labels.ts
- shared/constants/network.ts
- shared/modules/conversion.utils.ts
- shared/modules/hexstring-utils.ts
- shared/modules/string-utils.ts
- ui/helpers/constants/common.ts
- ui/helpers/constants/routes.ts
- Dependents:
- app/scripts/platforms/extension.js
- ui/components/app/alerts/unconnected-account-alert/unconnected-account-alert.js
- ui/components/app/connected-accounts-list/connected-accounts-list-item/connected-accounts-list-item.component.js
- ui/components/app/connected-accounts-permissions/connected-accounts-permissions.js
- ui/components/app/detected-token/detected-token-address/detected-token-address.js
- ui/components/app/modals/confirm-remove-account/confirm-remove-account.component.js
- ui/components/app/modals/qr-scanner/qr-scanner.component.js
- ui/components/app/permission-page-container/permission-page-container-content/permission-page-container-content.component.js
- ui/components/app/permission-page-container/permission-page-container.component.js
- ui/components/app/permissions-connect-permission-list/permissions-connect-permission-list.js
- ui/components/app/selected-account/selected-account.component.js
- ui/components/app/srp-input/srp-input.js
- ui/components/app/transaction-activity-log/transaction-activity-log.component.js
- ui/components/app/transaction-list-item-details/transaction-list-item-details.component.js
- ui/components/app/transaction-list-item/smart-transaction-list-item.component.js
- ui/components/app/transaction-list-item/transaction-list-item.component.js
- ui/components/app/transaction-list/transaction-list.component.js
- ui/components/ui/identicon/identicon.component.js
- ui/components/ui/nickname-popover/nickname-popover.component.js
- ui/components/ui/sender-to-recipient/sender-to-recipient.component.js
- ui/ducks/send/helpers.js
- ui/ducks/send/send.js
- ui/helpers/utils/gas.js
- ui/helpers/utils/permission.js
- ui/helpers/utils/token-util.js
- ui/helpers/utils/tx-helper.ts
- ui/hooks/useTransactionDisplayData.js
- ui/hooks/useTransactionDisplayData.test.js
- ui/pages/asset/components/native-asset.tsx
- ui/pages/asset/components/token-asset.tsx
- ui/pages/connected-accounts/connected-accounts.component.js
- ui/pages/connected-accounts/connected-accounts.container.js
- ui/pages/create-account/connect-hardware/account-list.js
- ui/pages/create-account/connect-hardware/index.js
- ui/pages/home/home.container.js
- ui/pages/permissions-connect/permissions-connect.container.js
- ui/pages/settings/contact-list-tab/add-contact/add-contact.component.js
- ui/pages/settings/settings.container.js
- ui/pages/swaps/searchable-item-list/item-list/item-list.component.js
- ui/pages/swaps/view-on-block-explorer/view-on-block-explorer.js
- ui/selectors/selectors.js

## **[Threat Modeling Framework](https://github.com/adamshostack/4QuestionFrame) (for technical tasks only)**

- What are we working on? Convert file to TypeScript.
- What can go wrong? Type errors, integration mismatches, missing types.
- What are we going to do about it? Write types carefully and test thoroughly.
- Did we do a good job? _(To be evaluated)_

## **Acceptance Criteria**

- File is fully converted to TypeScript.
- Tests pass.
- File adheres to linting rules.
- Functionality remains unchanged.

## **Stakeholder Review (for MetaMask employees only)**

- [X] Engineering
- [ ] Design
- [ ] Product
- [ ] QA
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management
- [ ] Other

## **References**

- Parent issue: #31460

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.