(self: any)
| 6 | */ |
| 7 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 8 | export default function autoBind(self: any) { |
| 9 | const keys = Object.getOwnPropertyNames(self.constructor.prototype); |
| 10 | for (let i = 0; i < keys.length; i++) { |
| 11 | const key = keys[i] as keyof typeof self; |
| 12 | const val = self[key]; |
| 13 | if (key !== 'constructor' && typeof val === 'function') { |
| 14 | self[key] = val.bind(self); |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | return self; |
| 19 | } |
no outgoing calls
no test coverage detected