(target, prop, receiver)
| 25 | |
| 26 | const wrappedCache = new Proxy(originalCache, { |
| 27 | get(target, prop, receiver) { |
| 28 | const originalMethod = target[prop as keyof typeof target] |
| 29 | |
| 30 | if (typeof originalMethod !== 'function') { |
| 31 | return originalMethod |
| 32 | } |
| 33 | |
| 34 | if (methodsNeedKeyPrefix.has(prop as string)) { |
| 35 | return function (this: any, key: string, ...args: any[]) { |
| 36 | const processedKey = processKey(key) |
| 37 | return originalMethod.call(target, processedKey, ...args) |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | if (prop === 'set') { |
| 42 | return function (this: any, key: string, value: any, ...args: any[]) { |
| 43 | const processedKey = processKey(key) |
| 44 | return originalMethod.call(target, processedKey, value, ...args) |
| 45 | } |
| 46 | } |
| 47 | return originalMethod.bind(target) |
| 48 | } |
| 49 | }) |
| 50 | |
| 51 | return { |
no test coverage detected