From 033fcd00f13ce8c4745585f69bf386c3803a135b Mon Sep 17 00:00:00 2001 From: Garrett Stevens Date: Tue, 19 Nov 2024 18:06:03 +0000 Subject: [PATCH] Remove all instances of structureClone --- packages/apollo-cli/src/utils.ts | 2 +- packages/apollo-shared/src/Changes/AddFeatureChange.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/apollo-cli/src/utils.ts b/packages/apollo-cli/src/utils.ts index 41a74815d..ba494b34e 100644 --- a/packages/apollo-cli/src/utils.ts +++ b/packages/apollo-cli/src/utils.ts @@ -123,7 +123,7 @@ export async function getAssembly( const assemblies = (await res.json()) as ApolloAssemblySnapshot[] for (const x of assemblies) { if (x._id === assemblyId[0]) { - return structuredClone(x) + return JSON.parse(JSON.stringify(x)) as ApolloAssemblySnapshot } } throw new Error(`Assembly "${assemblyNameOrId}" not found`) diff --git a/packages/apollo-shared/src/Changes/AddFeatureChange.ts b/packages/apollo-shared/src/Changes/AddFeatureChange.ts index 7f4dd2132..e250d909f 100644 --- a/packages/apollo-shared/src/Changes/AddFeatureChange.ts +++ b/packages/apollo-shared/src/Changes/AddFeatureChange.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/restrict-template-expressions */ - +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/require-await */ /* eslint-disable @typescript-eslint/no-unnecessary-condition */ import { @@ -143,7 +143,7 @@ export class AddFeatureChange extends FeatureChange { } attributes = { _id: [parentFeature._id.toString()], - ...structuredClone(attributes), + ...JSON.parse(JSON.stringify(attributes)), } parentFeature.attributes = attributes }