(nameFnOrTarget?: string | Function | Object, fnOrKey?: Function | string | symbol, descriptor?: PropertyDescriptor, attrs?: any)
| 244 | }; |
| 245 | |
| 246 | export function profile(nameFnOrTarget?: string | Function | Object, fnOrKey?: Function | string | symbol, descriptor?: PropertyDescriptor, attrs?: any): any { |
| 247 | if (typeof nameFnOrTarget === 'object' && (typeof fnOrKey === 'string' || typeof fnOrKey === 'symbol')) { |
| 248 | if (!profileFunctionFactory) { |
| 249 | return; |
| 250 | } |
| 251 | |
| 252 | return profileMethodUnnamed(nameFnOrTarget, fnOrKey, descriptor); |
| 253 | } else if (typeof nameFnOrTarget === 'function' && (typeof fnOrKey === 'string' || typeof fnOrKey === 'symbol')) { |
| 254 | if (!profileFunctionFactory) { |
| 255 | return; |
| 256 | } |
| 257 | |
| 258 | return profileStaticMethodUnnamed(nameFnOrTarget, fnOrKey, descriptor); |
| 259 | } else if (typeof nameFnOrTarget === 'string' && typeof fnOrKey === 'function') { |
| 260 | if (!profileFunctionFactory) { |
| 261 | return fnOrKey; |
| 262 | } |
| 263 | |
| 264 | return profileFunction(fnOrKey, nameFnOrTarget); |
| 265 | } else if (typeof nameFnOrTarget === 'function') { |
| 266 | if (!profileFunctionFactory) { |
| 267 | return nameFnOrTarget; |
| 268 | } |
| 269 | |
| 270 | return profileFunction(nameFnOrTarget); |
| 271 | } else if (typeof nameFnOrTarget === 'string') { |
| 272 | if (!profileFunctionFactory) { |
| 273 | return voidMethodDecorator; |
| 274 | } |
| 275 | |
| 276 | return profileMethodNamed(nameFnOrTarget); |
| 277 | } else { |
| 278 | if (!profileFunctionFactory) { |
| 279 | return voidMethodDecorator; |
| 280 | } |
| 281 | |
| 282 | return profileMethodUnnamed; |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | export function dumpProfiles(): void { |
| 287 | profileNames.forEach(function (name) { |
no test coverage detected