(str, associatedObjectForCache)
| 140 | |
| 141 | /** @type {MakeCacheableResult<T> & { bindCache: BindCache<T> }} */ |
| 142 | const fn = (str, associatedObjectForCache) => { |
| 143 | if (!associatedObjectForCache) return realFn(str); |
| 144 | const cache = getCache(associatedObjectForCache); |
| 145 | const entry = cache.get(str); |
| 146 | if (entry !== undefined) return entry; |
| 147 | const result = realFn(str); |
| 148 | cache.set(str, result); |
| 149 | return result; |
| 150 | }; |
| 151 | |
| 152 | /** @type {BindCache<T>} */ |
| 153 | fn.bindCache = (associatedObjectForCache) => { |
no test coverage detected