Skip to content

Commit 1aa5931

Browse files
committed
refactor: remove clonedeep dependency
This replacement with a shallow clone might look odd, but only one value at the root level is mutated. Also, because of a quirk with how clonedeep works with the AssetCss and AssetJs classes in podium utils, the entries in the css and js arrays weren't actually cloned – instead the values were copied. See podium-lib/utils#289 for a more thorough explanation with links to code.
1 parent 79a58e9 commit 1aa5931

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

lib/resolver.cache.js

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 abslog from 'abslog';
32
import assert from 'assert';
43

@@ -36,7 +35,7 @@ export default class PodletClientCacheResolver {
3635
if (outgoing.status !== 'stale') {
3736
const cached = this.#registry.get(outgoing.name);
3837
if (cached) {
39-
outgoing.manifest = clonedeep(cached);
38+
outgoing.manifest = { ...cached };
4039
outgoing.status = 'cached';
4140
this.#log.debug(
4241
`loaded manifest from cache - resource: ${outgoing.name}`,

package-lock.json

Lines changed: 0 additions & 7 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@
9797
"@podium/utils": "5.5.0",
9898
"abslog": "2.4.4",
9999
"http-cache-semantics": "^4.0.3",
100-
"lodash.clonedeep": "^4.5.0",
101100
"ttl-mem-cache": "4.1.0",
102101
"undici": "6.21.3"
103102
},

0 commit comments

Comments
 (0)