Function
_cached
(
target: AnyObject,
prop: string,
resolve: () => unknown
)
Source from the content-addressed store, hash-verified
| 216 | (Object.getPrototypeOf(value) === null || value.constructor === Object); |
| 217 | |
| 218 | function _cached( |
| 219 | target: AnyObject, |
| 220 | prop: string, |
| 221 | resolve: () => unknown |
| 222 | ) { |
| 223 | if (Object.prototype.hasOwnProperty.call(target, prop) || prop === 'constructor') { |
| 224 | return target[prop]; |
| 225 | } |
| 226 | |
| 227 | const value = resolve(); |
| 228 | // cache the resolved value |
| 229 | target[prop] = value; |
| 230 | return value; |
| 231 | } |
| 232 | |
| 233 | function _resolveWithContext( |
| 234 | target: ContextCache, |
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…