Express Sweet API Reference - v3.0.0
    Preparing search index...

    Variable isAsyncFunction

    isAsyncFunction: (value: any) => boolean

    Check if a value is specifically an async function. Returns true only for async functions, false for regular functions and other values.

    Type Declaration

      • (value: any): boolean
      • Parameters

        • value: any

          The value to check

        Returns boolean

        Returns true if value is an async function, false otherwise

    import isAsyncFunction from '~/utils/isAsyncFunction';

    isAsyncFunction(async () => {}); // true
    isAsyncFunction(() => {}); // false
    isAsyncFunction(function() {}); // false
    isAsyncFunction(''); // false