Skip to content

Commit

Permalink
fix: replace structuredClone with _cloneDeep (#1243)
Browse files Browse the repository at this point in the history
  • Loading branch information
brobro10000 authored Jan 6, 2025
1 parent 619db53 commit 4c04a62
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
17 changes: 9 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"videojs-youtube": "3.0.1"
},
"devDependencies": {
"@edx/browserslist-config": "1.1.1",
"@edx/browserslist-config": "1.4.0",
"@edx/typescript-config": "1.1.0",
"@faker-js/faker": "8.4.1",
"@openedx/frontend-build": "14.0.14",
Expand Down
3 changes: 2 additions & 1 deletion src/components/app/data/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _cloneDeep from 'lodash.clonedeep';
import { LICENSE_STATUS } from '../../enterprise-user-subsidy/data/constants';

export const emptyRedeemableLearnerCreditPolicies = {
Expand Down Expand Up @@ -84,7 +85,7 @@ export const getBaseSubscriptionsData = () => {
customerAgreement: null,
subscriptionLicense: null,
subscriptionPlan: null,
licensesByStatus: structuredClone(baseLicensesByStatus),
licensesByStatus: _cloneDeep(baseLicensesByStatus),
showExpirationNotifications: false,
};
return {
Expand Down
3 changes: 2 additions & 1 deletion src/components/app/data/services/programs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getConfig } from '@edx/frontend-platform/config';
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
import { camelCaseObject } from '@edx/frontend-platform/utils';
import { logError } from '@edx/frontend-platform/logging';
import _cloneDeep from 'lodash.clonedeep';
import { fetchEnterpriseCustomerContainsContent } from './content';
import { getAvailableCourseRuns } from '../utils';

Expand Down Expand Up @@ -52,7 +53,7 @@ export async function fetchProgramDetails(enterpriseUuid, programUuid) {
if (!programDetails) {
return null;
}
const programDetailsCopy = structuredClone(programDetails);
const programDetailsCopy = _cloneDeep(programDetails);
const { courses } = programDetailsCopy;
// Retrieve course keys
const courseKeys = courses.map(({ key }) => key);
Expand Down

0 comments on commit 4c04a62

Please sign in to comment.