* Wrap some method to add more feature
(
methodName: FunctionPropertyNames<SeriesData>,
injectFunction: (...args: any) => any
)
| 1363 | * Wrap some method to add more feature |
| 1364 | */ |
| 1365 | wrapMethod( |
| 1366 | methodName: FunctionPropertyNames<SeriesData>, |
| 1367 | injectFunction: (...args: any) => any |
| 1368 | ): void { |
| 1369 | const originalMethod = this[methodName]; |
| 1370 | if (!zrUtil.isFunction(originalMethod)) { |
| 1371 | return; |
| 1372 | } |
| 1373 | this.__wrappedMethods = this.__wrappedMethods || []; |
| 1374 | this.__wrappedMethods.push(methodName); |
| 1375 | this[methodName] = function () { |
| 1376 | const res = (originalMethod as any).apply(this, arguments); |
| 1377 | return injectFunction.apply(this, [res].concat(zrUtil.slice(arguments))); |
| 1378 | }; |
| 1379 | } |
| 1380 | |
| 1381 | |
| 1382 | // ---------------------------------------------------------- |
no outgoing calls
no test coverage detected