(isReadonly: boolean, shallow: boolean)
| 268 | } |
| 269 | |
| 270 | function createInstrumentationGetter(isReadonly: boolean, shallow: boolean) { |
| 271 | const instrumentations = createInstrumentations(isReadonly, shallow) |
| 272 | |
| 273 | return ( |
| 274 | target: CollectionTypes, |
| 275 | key: string | symbol, |
| 276 | receiver: CollectionTypes, |
| 277 | ) => { |
| 278 | if (key === ReactiveFlags.IS_REACTIVE) { |
| 279 | return !isReadonly |
| 280 | } else if (key === ReactiveFlags.IS_READONLY) { |
| 281 | return isReadonly |
| 282 | } else if (key === ReactiveFlags.RAW) { |
| 283 | return target |
| 284 | } |
| 285 | |
| 286 | return Reflect.get( |
| 287 | hasOwn(instrumentations, key) && key in target |
| 288 | ? instrumentations |
| 289 | : target, |
| 290 | key, |
| 291 | receiver, |
| 292 | ) |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | export const mutableCollectionHandlers: ProxyHandler<CollectionTypes> = { |
| 297 | get: /*@__PURE__*/ createInstrumentationGetter(false, false), |
no test coverage detected