(rawTarget: any[])
| 95 | const identityMethods = ['includes', 'indexOf', 'lastIndexOf'] as const |
| 96 | |
| 97 | function instrumentArr(rawTarget: any[]) { |
| 98 | const mutableTarget = rawTarget as Record< |
| 99 | (typeof identityMethods)[number], |
| 100 | any |
| 101 | > |
| 102 | identityMethods.forEach(key => { |
| 103 | const spy = vi.fn(rawTarget[key] as any) |
| 104 | mutableTarget[key] = spy |
| 105 | }) |
| 106 | } |
| 107 | |
| 108 | function searchValue(target: any[], ...args: unknown[]) { |
| 109 | return identityMethods.map(key => (target[key] as any)(...args)) |
no test coverage detected