Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Replace lodash cloneDeep with klona
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Apr 21, 2023
1 parent 8e3bb60 commit 8bebf88
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
10 changes: 5 additions & 5 deletions assets/js/data/cart/test/notify-quantity-changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { dispatch, select } from '@wordpress/data';
import { previewCart } from '@woocommerce/resource-previews';
import { cloneDeep } from 'lodash';
import { klona } from 'klona/json';
import { Cart, CartResponse } from '@woocommerce/types';
import { camelCaseKeys } from '@woocommerce/base-utils';

Expand Down Expand Up @@ -36,11 +36,11 @@ select.mockImplementation( () => {
*/
const getFreshCarts = (): { oldCart: Cart; newCart: Cart } => {
const oldCart = camelCaseKeys(
cloneDeep< CartResponse >( previewCart )
) as unknown as Cart;
klona< CartResponse >( previewCart )
) as Cart;
const newCart = camelCaseKeys(
cloneDeep< CartResponse >( previewCart )
) as unknown as Cart;
klona< CartResponse >( previewCart )
) as Cart;
return { oldCart, newCart };
};

Expand Down
10 changes: 7 additions & 3 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
"jest-fetch-mock": "3.0.3",
"jest-html-reporters": "3.0.10",
"json2md": "1.12.0",
"klona": "^2.0.6",
"lint-staged": "13.2.0",
"lodash": "4.17.21",
"markdown-it": "13.0.1",
Expand Down

0 comments on commit 8bebf88

Please sign in to comment.