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

    Variable isFunction

    isFunction: (value: any) => boolean

    Check if a value is a function (including async functions). Returns true for both regular and async functions, false otherwise.

    Type Declaration

      • (value: any): boolean
      • Parameters

        • value: any

          The value to check

        Returns boolean

        Returns true if value is a function, false otherwise

    import isFunction from '~/utils/isFunction';

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