(...sources: any)
| 55 | |
| 56 | export function mergeProxy<T extends any[]>(...sources: T): MergeProxy<T> |
| 57 | export function mergeProxy(...sources: any): any { |
| 58 | return new Proxy( |
| 59 | { |
| 60 | get(property: string | number | symbol) { |
| 61 | for (let i = sources.length - 1; i >= 0; i--) { |
| 62 | const v = resolveSource(sources[i])[property] |
| 63 | if (v !== undefined) return v |
| 64 | } |
| 65 | }, |
| 66 | has(property: string | number | symbol) { |
| 67 | for (let i = sources.length - 1; i >= 0; i--) { |
| 68 | if (property in resolveSource(sources[i])) return true |
| 69 | } |
| 70 | return false |
| 71 | }, |
| 72 | keys() { |
| 73 | const keys = [] |
| 74 | for (let i = 0; i < sources.length; i++) |
| 75 | keys.push(...Object.keys(resolveSource(sources[i]))) |
| 76 | return [...Array.from(new Set(keys))] |
| 77 | }, |
| 78 | }, |
| 79 | propTraps, |
| 80 | ) |
| 81 | } |
no outgoing calls
no test coverage detected