MetaMask / MetaMask/metamask-extension
[P1] util.js: close out — remove residuals and delete the file
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
**Parent Epic:** [#44552 — `util.js` decomposition](https://github.com/MetaMask/metamask-extension/issues/44552)
**Source:** `ui/helpers/utils/util.js`
**Size:** S
---
## Problem
After all groups relocate, only `isNullish` (2 refs) and `valuesFor` (1 ref, an `Object.values` wrapper) remain. The file should not survive as a near-empty catch-all.
## Solution
Replace `isNullish` with `@metamask/utils`' `isNullOrUndefined` (or a general predicates module); inline `valuesFor` as `Object.values(...)` at its single `tx-helper.ts` site. Then **delete `ui/helpers/utils/util.js` and `util.test.js`**.
## Acceptance Criteria
- [ ] `isNullish`/`valuesFor` handled; `util.js` + `util.test.js` deleted; no remaining imports of `utils/util`. Tests green.
Contributor guide
Research direction
Start with ui/helpers/utils/util.js and util.test.js, then search the two remaining isNullish references and the single valuesFor use in tx-helper.ts. Replace those usages with the specified alternatives, delete both utility files, and verify that no imports of utils/util remain and tests are green.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100