@web3r/flowerkit
Version:
Tree-shakable JavaScript and TypeScript utility library for frontend/browser apps: DOM, events, arrays, objects, strings, date, JSON, and network helpers (ESM/CJS, SSR-friendly).
14 lines (13 loc) • 427 B
text/typescript
export type TIsFnAsyncArgs = Parameters<typeof isFnAsync>;
export type TIsFnAsyncReturn = ReturnType<typeof isFnAsync>;
/**
* Checks if a function is async
* @param {*} fn source function
* @returns {boolean}
* @example
* // How to check if function is async?
* const fn = async () => {};
* const isAsync = isFnAsync(fn);
* console.log(isAsync); // => true
*/
export declare const isFnAsync: (fn: unknown) => boolean;