Skip to content

Commit

Permalink
fix: structuredClone not available in v16
Browse files Browse the repository at this point in the history
  • Loading branch information
montelaidev committed May 29, 2024
1 parent 91e1c4c commit f0c79a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/accounts-controller/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { toBuffer } from '@ethereumjs/util';
import { isCustodyKeyring, KeyringTypes } from '@metamask/keyring-controller';
import { deepClone } from '@metamask/snaps-utils';
import { sha256 } from 'ethereum-cryptography/sha256';
import type { Draft } from 'immer';
import type { V4Options } from 'uuid';
Expand Down Expand Up @@ -96,5 +97,5 @@ export function deepCloneDraft(
obj: Draft<AccountsControllerState>,
): AccountsControllerState {
// We use unknown here because the type inference when using structured clone leads to the same type error.
return structuredClone(obj) as unknown as AccountsControllerState;
return deepClone(obj) as unknown as AccountsControllerState;
}

0 comments on commit f0c79a4

Please sign in to comment.