Skip to content

Commit 37f9484

Browse files
committed
Remove lodash
1 parent 2e95b37 commit 37f9484

File tree

5 files changed

+17
-36
lines changed

5 files changed

+17
-36
lines changed

eslint.config.mjs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,18 @@ export default tseslint.config(
3030
"@typescript-eslint/await-thenable": "error",
3131
"prefer-arrow-callback": ["warn"],
3232
},
33-
}, {
34-
files: ["**/*.ts", "**/*.js"],
35-
},
33+
},
34+
{
35+
files: ["**/*.ts", "**/*.js"],
36+
},
3637
{
37-
ignores: ["**/dist", "**/docs", "**/node_modules", "jest.config.js", "eslint.config.mjs"],
38+
ignores: [
39+
"**/dist",
40+
"**/docs",
41+
"**/node_modules",
42+
"jest.config.js",
43+
"eslint.config.mjs",
44+
"coverage",
45+
],
3846
},
3947
);

package-lock.json

Lines changed: 0 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"devDependencies": {
2424
"@eslint/js": "^9.10.0",
2525
"@types/jest": "^29.2.0",
26-
"@types/lodash.clonedeep": "^4.5.4",
2726
"@types/node": "^22.1.0",
2827
"@types/validator": "^13.0.0",
2928
"eslint": "^9.10.0",
@@ -33,7 +32,6 @@
3332
"husky": "^9.0.7",
3433
"jest": "^29.5.0",
3534
"lint-staged": "^15.0.1",
36-
"lodash.clonedeep": "^4.5.0",
3735
"nock": "^13.0.2",
3836
"prettier": "^3.0.0",
3937
"ts-jest": "^29.1.0",

src/response/models/insights.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import cloneDeep from 'lodash.clonedeep';
21
import * as insightsJson from '../../../fixtures/insights.json';
32
import { InsightsResponse } from '../web-records';
43
import Insights from './insights';
@@ -8,7 +7,7 @@ describe('Insights()', () => {
87
let response: any;
98

109
beforeEach(() => {
11-
const fixture = cloneDeep(insightsJson);
10+
const fixture = structuredClone(insightsJson);
1211
response = fixture.response.full;
1312
});
1413

src/webServiceClient.spec.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import cloneDeep from 'lodash.clonedeep';
21
import nock from 'nock';
32
import * as models from './response/models';
43
import * as insights from '../fixtures/insights.json';
@@ -26,9 +25,9 @@ const client = new Client(auth.user, auth.pass);
2625

2726
describe('WebServiceClient', () => {
2827
// eslint-disable-next-line @typescript-eslint/no-explicit-any
29-
const factors = cloneDeep(insights) as any;
30-
factors.response.full.risk_score_reasons = cloneDeep(reasons);
31-
factors.response.full.subscores = cloneDeep(subscores);
28+
const factors = structuredClone(insights) as any;
29+
factors.response.full.risk_score_reasons = structuredClone(reasons);
30+
factors.response.full.subscores = structuredClone(subscores);
3231

3332
describe('factors()', () => {
3433
const transaction = new Transaction({
@@ -515,7 +514,7 @@ describe('WebServiceClient', () => {
515514
${'email'}
516515
${'shipping_address'}
517516
`('handles missing response $property', async ({ property }) => {
518-
const response = cloneDeep(insights.response.full);
517+
const response = structuredClone(insights.response.full);
519518
delete response[property as keyof webRecords.InsightsResponse];
520519

521520
nockInstance

0 commit comments

Comments
 (0)