MetaMask / MetaMask/metamask-extension

[P1] util.js: close out — remove residuals and delete the file

Open
#44,565 1 comment 0 reactions 0 assignees View on GitHub
exalate-duplicate INVALID-ISSUE-TEMPLATE mig-epic-70-child team-extension-platform
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.