()
| 42 | build: () => T, |
| 43 | purge?: (t: T) => T | undefined |
| 44 | ): T { |
| 45 | if (this._entries[cacheName] === undefined) { |
| 46 | try { |
| 47 | this._entries[cacheName] = { |
| 48 | build: build as () => unknown, |
| 49 | purge: purge as ((v: unknown) => unknown) | undefined, |
| 50 | value: build(), |
| 51 | }; |
| 52 | } catch (e) { |
| 53 | // An interruption (timeout/abort) is not a cache failure: let it |
| 54 | // propagate, and leave the entry unbuilt so a later call retries. |
| 55 | // Swallowing it would return `undefined` to the caller and surface as |