Skip to content

Commit c860098

Browse files
committed
fixup
1 parent b114ce4 commit c860098

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/cache/memory-cache-store.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ class MemoryCacheStore {
8080
get (key) {
8181
const values = this.#getValuesForRequest(key)
8282
const value = findValue(key, values)
83+
84+
// TODO (perf): Faster with explicit props...
8385
return value != null ? { ...value } : undefined
8486
}
8587

@@ -109,9 +111,10 @@ class MemoryCacheStore {
109111
const store = this
110112
const body = []
111113

112-
// TODO (fix): Make sure user can't modify...
113-
// key = structuredClone(key)
114-
// opts = structuredClone(opts)
114+
// TODO (fix): Deep clone...
115+
// TODO (perf): Faster with explicit props...
116+
key = { ...key }
117+
opts = { ...opts }
115118

116119
return new Writable({
117120
write (chunk, encoding, callback) {

0 commit comments

Comments
 (0)