Spaces:
Running
Running
Download node_modules/@mswjs/interceptors/src/utils/findPropertySource.ts from fffiloni/live-vision: direct link, hf CLI and curl.
- Browser
- Download file 553 Bytes
-
https://huggingface.co/spaces/fffiloni/live-vision/resolve/main/node_modules/%40mswjs/interceptors/src/utils/findPropertySource.ts
- Command line
-
hf download hf://spaces/fffiloni/live-vision/node_modules/@mswjs/interceptors/src/utils/findPropertySource.ts
-
curl -L -o findPropertySource.ts https://huggingface.co/spaces/fffiloni/live-vision/resolve/main/node_modules/%40mswjs/interceptors/src/utils/findPropertySource.ts
553 Bytes
| /** | |
| * Returns the source object of the given property on the target object | |
| * (the target itself, any parent in its prototype, or null). | |
| */ | |
| export function findPropertySource( | |
| target: object, | |
| propertyName: string | symbol | |
| ): object | null { | |
| if (!(propertyName in target)) { | |
| return null | |
| } | |
| const hasProperty = Object.prototype.hasOwnProperty.call(target, propertyName) | |
| if (hasProperty) { | |
| return target | |
| } | |
| const prototype = Reflect.getPrototypeOf(target) | |
| return prototype ? findPropertySource(prototype, propertyName) : null | |
| } | |