(callback: T)
| 248 | * @returns The result of the function. |
| 249 | */ |
| 250 | const lazy = <T extends (...args: any[]) => any>(callback: T) => { |
| 251 | let res: ReturnType<T>; |
| 252 | let processed = false; |
| 253 | return (...args: Parameters<T>): ReturnType<T> => { |
| 254 | if (processed) return res; |
| 255 | res = callback(...args); |
| 256 | processed = true; |
| 257 | return res; |
| 258 | }; |
| 259 | }; |
| 260 | |
| 261 | /** |
| 262 | * Generates an external link by appending the given URL to the "https://extern?" endpoint. |
no outgoing calls
no test coverage detected