Skip to content

Commit

Permalink
Remove lodash dependency when caching in favor of native `structuredC…
Browse files Browse the repository at this point in the history
…lone`

Change-type: major
  • Loading branch information
Page- committed Sep 13, 2024
1 parent 4703faa commit 44a9481
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
},
"license": "MIT",
"dependencies": {
"@types/lodash": "^4.17.5",
"@types/request": "^2.48.12",
"lodash": "^4.17.21",
"lru-cache": "^11.0.1",
"pinejs-client-core": "^8.0.0",
"request": "^2.88.2",
Expand Down
4 changes: 1 addition & 3 deletions request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ export class PinejsClientRequest<
}

this.cache.set(params.url, cached);
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { cloneDeep } = require('lodash') as typeof import('lodash');
return cloneDeep(cached.body);
return structuredClone(cached.body);
} else {
const { statusCode, body, headers } = await requestAsync(params);
if (200 <= statusCode && statusCode < 300) {
Expand Down

0 comments on commit 44a9481

Please sign in to comment.