Skip to content
This repository was archived by the owner on Sep 11, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- **BREAKING:** Bump TypeScript target to ES2022 ([#332](https://github.com/MetaMask/utils/pull/332))
- This package now ships ES2022 code, requiring a compatible modern environment or bundler configuration to consume.
- **BREAKING:** Drop support for Node 18 and 20 ([#328](https://github.com/MetaMask/utils/pull/328))
- **BREAKING:** Drop CommonJS support ([#9536](https://github.com/MetaMask/core/pull/9536))
- This package is now ESM-only, but can still be used in CommonJS projects via `require(esm)` in modern Node.js versions (22+), or dynamic imports in older Node.js versions.
Expand Down
7 changes: 0 additions & 7 deletions src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,8 @@ export function wrapError<Throwable>(
if (isError(originalError)) {
let error: Error & { code?: string };
if (Error.length === 2) {
// for some reason `tsserver` is not complaining that the
// Error constructor doesn't support a second argument in the editor,
// but `tsc` does. Error causes are not supported by our current tsc target (ES2020, we need ES2022 to make this work)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
error = new Error(message, { cause: originalError });
} else {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
error = new ErrorWithCause(message, { cause: originalError });
}

Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"lib": ["ES2020", "DOM"],
"lib": ["ES2022", "DOM"],
"module": "Node16",
"moduleResolution": "Node16",
"noEmit": true,
"noErrorTruncation": true,
"noUncheckedIndexedAccess": true,
"strict": true,
"target": "ES2020"
"target": "ES2022"
},
"exclude": ["./dist/**/*"]
}
Loading